2
votes

I am following this https://cloud.google.com/solutions/mobile/how-to-build-mobile-app-with-app-engine-backend-tutorial/ google official tutorial to try to run the Mobile Shopping Assistant sample code on Mac OSX Yosemite. It works fine on local dev_server, but not work for uploading csv data to GAE datastore.

If I run the command line: appcfg.py upload_data --config_file bulkloader.yaml --url=http:///remote_api --filename places.csv --kind=Place -e

I am getting this error from the terminal:

Rovyns-MacBook-Pro:test Rovyn$ appcfg.py upload_data --config_file bulkloader.yaml --url=http://mobile-shopping-assistant-0000/remote_api --filename places.csv --kind=Place -e [email protected]
12:47 PM Uploading data records.
[INFO    ] Logging to bulkloader-log-20150731.124745
Traceback (most recent call last):
  File "/usr/local/bin/appcfg.py", line 133, in <module>
    run_file(__file__, globals())
  File "/usr/local/bin/appcfg.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5445, in <module>
    main(sys.argv)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5436, in main
    result = AppCfgApp(argv).Run()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2997, in Run
    self.action(self)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 5092, in __call__
    return method()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4895, in PerformUpload
    run_fn(args)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4777, in RunBulkloader
    sys.exit(bulkloader.Run(arg_dict))
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4405, in Run
    return _PerformBulkload(arg_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4145, in _PerformBulkload
    passin = arg_dict['passin']
KeyError: 'passin'

And, If run: bulkloader.py --url=http://mobile-shopping-assitant-0000.appspot.com/remote_api --kind=Place --filename=places.csv --config_file=bulkloader.yaml

Error:

[INFO    ] Logging to bulkloader-log-20150731.122714
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
Please enter login credentials for mobile-shopping-assistant-0000.appspot.com
Email: [email protected]
Password for [email protected]: 
Traceback (most recent call last):
  File "/usr/local/bin/bulkloader.py", line 133, in <module>
    run_file(__file__, globals())
  File "/usr/local/bin/bulkloader.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4427, in <module>
    sys.exit(main(sys.argv))
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4423, in main
    return _PerformBulkload(arg_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4191, in _PerformBulkload
    throttle_class=throttle_class)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4098, in _GetRemoteAppId
    rpc_server_factory=throttled_rpc_server_factory, secure=secure)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 660, in GetRemoteAppId
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 422, in Send
    self._Authenticate()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 550, in _Authenticate
    super(HttpRpcServer, self)._Authenticate()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 293, in _Authenticate
    auth_token = self._GetAuthToken(credentials[0], credentials[1])
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py", line 245, in _GetAuthToken
    e.headers, response_dict)
google.appengine.tools.appengine_rpc.ClientLoginError: HTTP Error 403: Forbidden

I am very sure I followed the instruction from the tutorial very carefully and correctly, please help me solve this issue, thank you in advance.

1

1 Answers

0
votes

There is a known issue with the bulkloader (upload_data) as seen here. You have two options:

a) Use the bulkloader.py (run 'bulkloader.py help' on the command line for details)

b) Use the work around found here.

Option B will be the easiest if you are just interested in the tutorial.