我正在关注此https://cloud.google.com/solutions/mobile/how-to-build-mobile-app-with-app-engine-backend-tutorial/ google官方教程,尝试在Mac OSX Yosemite上运行Mobile Shopping Assistant示例代码。它在本地dev_server上运行正常,但无法将csv数据上传到GAE数据存储区。
如果我运行命令行: appcfg.py upload_data --config_file bulkloader.yaml --url = http:/// remote_api --filename places.csv --kind = Place -e
我从终端收到此错误:
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 rovyn@gmail.com
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'
并且,如果运行: bulkloader.py --url = http://mobile-shopping-assitant-0000.appspot.com/remote_api --kind = Place --filename = places.csv --config_file = bulkloader.yaml
错误:
[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: rovyn@gmail.com
Password for rovyn@gmail.com:
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
我非常确定我非常认真地遵循了教程中的说明,请帮我解决这个问题,提前谢谢。
答案 0 :(得分:0)
bulkloader(upload_data)存在已知问题seen here.您有两个选择:
a)使用bulkloader.py(在命令行上运行'bulkloader.py help'获取详细信息)
b)使用找到here的工作。
如果您只对本教程感兴趣,选项B将是最简单的。