kolinko
kolinko

Reputation: 1663

GAE data download shows datastore_errors.BadRequestError

I'm trying to download data from my Google App Engine app, using the official instructions

Remote API is set up & I call:

appcfg.py download_data --application=appname --url=http://app.address.com/_ah/remote_api --filename=alldata.csv

The connection is established, I'm being asked for my e-mail & password, and then a long trace appears ending up with this:

google.appengine.api.datastore_errors.BadRequestError: app s~appname cannot access app appname's data

Any ideas?

Upvotes: 9

Views: 1856

Answers (3)

JP Lodine
JP Lodine

Reputation: 489

I ran into this same issue, but when attempting to use the remote API from a custom script as opposed to appcfg.py's bulk downloader.

This issue may have been addressed in more recent GAE SDK releases, but for various reasons I'm still using the older 1.7 release. I found the answer in this bug report: https://code.google.com/p/googleappengine/issues/detail?id=4374

Basically, when calling ConfigureRemoteApi, don't specify the APP_ID argument (just pass None) and specify your app ID via the host argument, e.g. 'myapp-hrd.appspot.com'. ConfigureRemoteApi will figure out your app ID correctly and won't add the 's~' that causes this problem.

Upvotes: 0

Chris Lacy
Chris Lacy

Reputation: 4462

If using the high-replication datastore, change the value passed to --application from appname to s~appname.

Upvotes: 26

kolinko
kolinko

Reputation: 1663

Found the problem - as an URL I was giving my own app's domain name instead of the 1.appname.appspot.com.

Upvotes: 0

Related Questions