0
votes

I have a set of data that I would like to use for production but I can't seem to get appcfg.py to download the localhost datastore. I have localhost:8080/_ah/remote_api on in app.yaml then, in the SDK shell, i ran

appcfg.py download_data --filename=local.db --url=http://localhost:8080/_ah/remote_api -A [MYAPPID]

I get this error message:

You must be logged in as an administrator to access this.

I can't find a way to authenticate my google account as the admin. any advice?

1

1 Answers

1
votes

This is a general issue of remote_api admin authentication to the local development server, you may want to star it: https://code.google.com/p/googleappengine/issues/detail?id=12445. Several workaround suggestions in there (YMMV according to other posts)

The most recent one (2 days old) looks promising:

Workaround for appcfg.py upload_data to local dev server, "Refreshing due to a 401" issue. Tested using Java dev server 1.9.42:

  1. Log into the local dev server Development Console in a browser.

  2. Open your browser's dev tools and pull the value for the dev_appserver_login cookie.

  3. Edit lib/oauth2client/oauth2client/client.py in the app.

  4. Find "def new_request" function. Before line self.apply(headers) in this function, add:

    headers['Cookie'] = 'dev_appserver_login=your-cookie-value-here';
    
  5. Run the upload_data command.

There's also this recipe, successful at the time, but it might be a bit old now: appcfg.py shows You must be logged in as an administrator