appcfg.py upload_data在Google App Engine SDK 1.8.2中失败

时间:2013-08-05 14:21:55

标签: google-app-engine

我在Mac OS X 10.6.8系统上使用Google App Engine SDK 1.8.2版。应用程序本身是用Python 2.7编写的,虽然我不认为这与问题有关。当我尝试在开发环境中批量加载数据存储区时,它会失败。我使用的命令是:

appcfg.py upload_data --config_file=bulkloader.yaml --kind=Capitulary --url=http://localhost:8080/_ah/remote_api --filename=upload.xml

此命令适用于可追溯到2010年的每个版本的SDK。当SDK版本1.8.0发布时它突然出现,当1.8.1出现时它再次起作用,并且当1.8.2出现时再次破坏。

提前感谢您的帮助。

以下错误消息:

  

INFO 2013-08-05 14:19:05,312 module.py:595]默认:" GET   / _ah / remote_api?rtok = 215098893971 HTTP / 1.1" 200 70 INFO 2013-08-05   14:19:05,569 module.py:595]默认值:" GET / _ah / remote_api HTTP / 1.1"   200 42 ERROR 2013-08-05 14:19:05,716 handler.py:384]例外   处理service_name时:" datastore_v4"方法:" AllocateIds"   要求:"" Traceback(最近一次调用最后一次):文件   " /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/handler.py" ;,   第380行,在帖子中       response_data = self.ExecuteRequest(request)File" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/handler.py" ,   第411行,在ExecuteRequest中       response_data)文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py",   第94行,在MakeSyncCall中       return stubmap.MakeSyncCall(服务,调用,请求,响应)文件   " /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py" ;,   MakeSyncCall中的第328行       rpc.CheckSuccess()文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_rpc.py",   第156行,在_WaitImpl中       self.request,self.response)File" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py" ,   第200行,在MakeSyncCall中       self._MakeRealSyncCall(服务,电话,请求,响应)文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub。 PY&#34 ;,   第234行,在_MakeRealSyncCall中       raise pickle.loads(response_pb.exception())AttributeError:' NoneType'对象没有属性' THREADSAFE' INFO 2013-08-05   14:19:05,773 module.py:595]默认值:" POST / _ah / remote_api HTTP / 1.1"   200 96 ERROR 2013-08-05 14:19:05,793 handler.py:384]例外   处理service_name时:" datastore_v4"方法:" AllocateIds"   要求:"" Traceback(最近一次调用最后一次):文件   " /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/handler.py" ;,   第380行,在帖子中       response_data = self.ExecuteRequest(request)File" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/handler.py" ,   第411行,在ExecuteRequest中       response_data)文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py",   第94行,在MakeSyncCall中       return stubmap.MakeSyncCall(服务,调用,请求,响应)文件   " /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_stub_map.py" ;,   MakeSyncCall中的第328行       rpc.CheckSuccess()文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/apiproxy_rpc.py",   第156行,在_WaitImpl中       self.request,self.response)File" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py" ,   第200行,在MakeSyncCall中       self._MakeRealSyncCall(服务,电话,请求,响应)文件" /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub。 PY&#34 ;,   第234行,在_MakeRealSyncCall中       raise pickle.loads(response_pb.exception())AttributeError:' NoneType'对象没有属性' THREADSAFE' INFO 2013-08-05   14:19:05,802 module.py:595]默认值:" POST / _ah / remote_api HTTP / 1.1"   200 96

3 个答案:

答案 0 :(得分:2)

<强> TL; DR:我通过在第228行的google \ appengine \ ext \ remote \ _api \ remote_api_stub.py中添加return response.ParseFromString(response_pb.response())来解决此错误

我在SDK 1.8.3中有类似的错误,这里是Traceback:

Traceback (most recent call last):

  File "C:\Dev\GAE\google\appengine\ext\remote_api\handler.py", line 380, in post
    response_data = self.ExecuteRequest(request)

  File "C:\Dev\GAE\google\appengine\ext\remote_api\handler.py", line 411, in ExecuteRequest
    response_data)

  File "C:\Dev\GAE\google\appengine\api\apiproxy_stub_map.py", line 94, in MakeSyncCall
    return stubmap.MakeSyncCall(service, call, request, response)

  File "C:\Dev\GAE\google\appengine\api\apiproxy_stub_map.py", line 328, in MakeSyncCall
    rpc.CheckSuccess()

  File "C:\Dev\GAE\google\appengine\api\apiproxy_rpc.py", line 156, in _WaitImpl
    self.request, self.response)

  File "C:\Dev\GAE\google\appengine\ext\remote_api\remote_api_stub.py", line 200, in MakeSyncCall
    self._MakeRealSyncCall(service, call, request, response)

  File "C:\Dev\GAE\google\appengine\ext\remote_api\remote_api_stub.py", line 234, in _MakeRealSyncCall
    raise pickle.loads(response_pb.exception())

AttributeError: 'NoneType' object has no attribute 'THREADSAFE'

我有点'黑客'围绕它(:在第228行的remote_api_stub.py中我添加了return response.ParseFromString(response_pb.response()),因此忽略了有问题的错误检查.upload_data现在正常工作,但我们希望他们在下一个版本中解决此问题(;

return response.ParseFromString(response_pb.response())
if response_pb.has_application_error():
  error_pb = response_pb.application_error()
  raise apiproxy_errors.ApplicationError(error_pb.code(),
                                         error_pb.detail())
elif response_pb.has_exception():
  raise pickle.loads(response_pb.exception())
elif response_pb.has_java_exception():
  raise UnknownJavaServerError("An unknown error has occured in the "
                               "Java remote_api handler for this call.")
else:
  response.ParseFromString(response_pb.response())

答案 1 :(得分:1)

我们知道这个问题正在修复。我们正在appengine issue 9666跟踪此问题,请观看该主题以获取更新。很高兴你现在有一个解决方法。这不会影响批量生产操作。

答案 2 :(得分:1)

我在SDK 1.8.5中遇到了同样的问题,可以验证它现在适用于1.8.6!