Greg
Greg

Reputation: 2609

appcfg.py upload_data won't ask for authentication locally

In the local development environment, the upload_data command will not launch a browser for OAuth. Why is that?!?

The code works perfectly fine on App Engine but not the local development environment. Is there a trick to use the remote API for the dev environment.

Here's how I use the command...

appcfg.py upload_data --config_file=bulkloader.yaml --filename=./stops.txt --kind=StopLocationLoader --url=http://localhost:8082/_ah/remote_api
10:39 PM Uploading data records.
[INFO    ] Logging to bulkloader-log-20161017.223916
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.
--- end server output ---

Upvotes: 0

Views: 299

Answers (1)

TomTasche
TomTasche

Reputation: 5526

This is a bug: https://code.google.com/p/googleappengine/issues/detail?id=12445

It links to a workaround posted for another question:

gcloud auth login
gcloud auth print-access-token
appcfg.py upload_data --oauth2_access_token=<oauth2_access_token> --config_file bulkloader.yaml --url=http://<yourproject>.appspot.com/remote_api --filename places.csv --kind=Place --email=<[email protected]>

Upvotes: 1

Related Questions