#!/bin/bash
date=`date +%Y%m%d`
appid=myappid
url="https://$appid.appspot.com/_ah/remote_api"
GOOGLE_APPLICATION_CREDENTIALS=myapp.json appcfg.py download_data -v -e myemail@gmail.com --application=s~$appid --url=$url --filename=allentities-$date.sql3
rm -f bulkloader-*
appcfg.py list_versions
2016-04-17 19:21:29,316 INFO client.py:546 Attempting refresh to obtain initial access_token
2016-04-17 19:21:29,378 INFO client.py:804 Refreshing access_token
2016-04-17 19:21:30,901 INFO client.py:578 Refreshing due to a 401 (attempt 1/2)
2016-04-17 19:21:30,988 INFO client.py:804 Refreshing access_token
2016-04-17 19:21:31,570 INFO client.py:578 Refreshing due to a 401 (attempt 2/2) 2016-04-17 19:21:31,659 INFO client.py:804 Refreshing access_token 2016-04-17 19:21:32,436 INFO client.py:578 Refreshing due to a 401 (attempt 1/2) 2016-04-17 19:21:32,526 INFO client.py:804 Refreshing access_token 2016-04-17 19:21:33,162 INFO client.py:578 Refreshing due to a 401 (attempt 2/2) [...]
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.
--- end server output ---
2016-07-01 17:55:25,147 INFO client.py:981 Timeout attempting to reach GCE metadata service.
Traceback (most recent call last):
File "/home/solstice/Applications/google_appengine/appcfg.py", line 133, in <module>
run_file(__file__, globals())
File "/home/solstice/Applications/google_appengine/appcfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 5495, in <module>
main(sys.argv)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 5486, in main
result = AppCfgApp(argv).Run()
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 2964, in Run
self.action(self)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 5142, in __call__
return method()
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 4924, in PerformDownload
run_fn(args)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/appcfg.py", line 4829, in RunBulkloader
sys.exit(bulkloader.Run(arg_dict, self._GetOAuth2Parameters()))
File "/home/solstice/Applications/google_appengine/google/appengine/tools/bulkloader.py", line 4349, in Run
return _PerformBulkload(arg_dict, oauth2_parameters)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/bulkloader.py", line 4242, in _PerformBulkload
return_code = app.Run()
File "/home/solstice/Applications/google_appengine/google/appengine/tools/bulkloader.py", line 3408, in Run
oauth2_parameters=self.oauth2_parameters)
File "/home/solstice/Applications/google_appengine/google/appengine/tools/bulkloader.py", line 1280, in __init__
rpc_server_factory=throttled_rpc_server_factory)
File "/home/solstice/Applications/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 747, in ConfigureRemoteApiForOAuth
credentials = client.GoogleCredentials.get_application_default()
File "/home/solstice/Applications/google_appengine/lib/oauth2client/oauth2client/client.py", line 1211, in get_application_default
return GoogleCredentials._get_implicit_credentials()
File "/home/solstice/Applications/google_appengine/lib/oauth2client/oauth2client/client.py", line 1201, in _get_implicit_credentials
raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)
oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/p9Jx-b5ckx0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/a17043c9-1219-4274-9db4-b77938e6e9a2%40googlegroups.com.
2016-04-19 16:40 GMT+02:00 'Nick (Cloud Platform Support)' via Google App Engine <google-appengine@googlegroups.com>:
Hey solsTiCe,
Unfortunately it's not quite clear to me which instructions you're following. Also, it seems strange that you'd need both credentials and a token. Could you be a little more specific about exactly what steps you're following to build "myapp.json"?
Additionally, I can see in your bash script that you use "application=s~$appid", could you attempt a test without the '~s'?
Thanks for clarifying,
Nick
Cloud Platform Community Support
On Tuesday, April 19, 2016 at 6:31:54 AM UTC-4, solsTiCe d'Hiver wrote:hi nick,
- the oauth2 token is associated with an account which is owner of the app.
- to generate the credentials file I followed the instructions in the url I gave. It seems both the oath2 token and the credentials is needed ? or the oath2 is ignored ?
-I have not s~ in my bash script.
I am trying to do that on the real server not the local dev server.
--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/p9Jx-b5ckx0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.