Uncategorized

Google App Engine Bulkloader Refreshing due to a 401 Loop


Developing apps on Google App Engine can be difficult when your production servers have a dataset that is hard to reproduce on your local development servers. Thankfully Google App Engine includes a very useful tool to do bulkloading.

To download your data from production:

appcfg.py download_data --url=http://{APPID}.appspot.com/_ah/remote_api --filename=data.sqlite --batch_size=500 --kind={ENTITYTYPE}

To upload your data into local development:

appcfg.py upload_data --url=http://localhost:8080/_ah/remote_api --filename=data.sqlite --batch_size=500


 

Unfortunately if you are updating to the latest version of Google App Engine Launcher, it has recently stopped working. The download works fine with the new OAuth2 defaults on production but when you go to upload your dataset, it will give the following errors:

2015-11-17 22:16:19,421 INFO client.py:797 Refreshing access_token
2015-11-17 22:16:19,526 INFO client.py:571 Refreshing due to a 401 (attempt 2/2)
2015-11-17 22:16:19,526 INFO client.py:797 Refreshing access_token
2015-11-17 22:16:19,621 INFO client.py:571 Refreshing due to a 401 (attempt 2/2)
2015-11-17 22:16:19,621 INFO client.py:797 Refreshing access_token
2015-11-17 22:16:19,718 INFO client.py:571 Refreshing due to a 401 (attempt 1/2)
2015-11-17 22:16:19,718 INFO client.py:797 Refreshing access_token
2015-11-17 22:16:19,811 INFO client.py:571 Refreshing due to a 401 (attempt 2/2)
2015-11-17 22:16:19,811 INFO client.py:797 Refreshing access_token
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.

 

Solution

Download a previous version of GAE from this link to do the upload:

https://console.developers.google.com/storage/browser/appengine-sdks/deprecated/190/


I'm a 31 year old UIUC Computer Engineer building mobile apps, websites and hardware integrations with an interest in 3D printing, biotechnology and Arduinos.

View Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.