【问题标题】:Google App Engine remote_api returns 404 using remote_api_shell.pyGoogle App Engine remote_api 使用 remote_api_shell.py 返回 404
【发布时间】:2013-09-09 23:59:16
【问题描述】:

我正在使用谷歌内置工具连接到远程 api,所以我的客户端或 app.yaml 中什至没有我可以更改的信息。我不知道为什么我突然无法连接。

[ rever ~/Documents/buybottmerge/buybott-gae ] remote_api_shell.py -s myappname.appspot.com
Traceback (most recent call last):
  File "/usr/local/bin/remote_api_shell.py", line 171, in <module>
    run_file(__file__, globals())
  File "/usr/local/bin/remote_api_shell.py", line 167, in run_file
    execfile(script_path, globals_)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/remote_api_shell.py", line 152, in <module>
    main(sys.argv)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/remote_api_shell.py", line 148, in main
    appengine_rpc.HttpRpcServer)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/remote_api_shell.py", line 76, in remote_api_shell
    rpc_server_factory=rpc_server_factory)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 725, in ConfigureRemoteApi
    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 568, 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 393, in Send
    f = self.opener.open(req)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

我也可以在仪表板的日志中看到错误。因此,有些东西运行良好,足以让它在失败之前走得那么远。

2013-09-05 18:13:35.735 /_ah/remote_api?rtok=569217424211 404 4ms 0kb Google-remote_api/1.0     Darwin/12.4.0 Python/2.7.2.final.0 gzip

50.53.136.79 - - [05/Sep/2013:18:13:35 -0700] "GET /_ah/remote_api?rtok=569217424211   HTTP/1.1" 404 130 - "Google-remote_api/1.0 Darwin/12.4.0 Python/2.7.2.final.0 gzip"   "myappname.appspot.com" ms=4 cpu_ms=0 cpm_usd=0.000015 app_engine_release=1.8.4   instance=00c61b117cbd87090d90186a5635840f196c4d14

【问题讨论】:

  • 你的 app.yaml 中有内置函数吗:-remote_api: on?
  • 嗯,我会仔细检查 app.yaml 并重新部署。如果失败,则会引发生产问题。 (我一直使用远程 api 并且从来没有遇到过这个问题,除非忘记在内置函数中启用 remote_api,或者在过去忘记在 app.yaml 中映射 remote_api 处理程序
  • @TimHoffman 是的,我尝试了所有这些,仍然失败。我刚决定提出一个问题here。在这个问题得到解决之前,我无法真正从事我的项目:/

标签: python google-app-engine remote-access remoteapi


【解决方案1】:

我知道这有点晚了,但是您是否在您的应用中使用了 git push-to-deploy 功能?

我发现 app.yaml 中定义的“内置”在推送部署后不起作用(它们返回 404),但进行正常的 appcfg 更新会使它们再次工作。

在使用 remote_api 和 deferred 进行推送部署后,我遇到了这些 404 失败。

【讨论】:

    【解决方案2】:

    如果您像我一样关注此doc 并使用“buildins”,我发现错误是由于文档中的拼写错误造成的。

    /remote_api ==> /_ah/remote_api

    【讨论】:

      【解决方案3】:
      • 对我来说,问题是我以错误的方式启动了脚本 project.appspot.com 名称。小心

      • 还应首先部署项目:

      内置:

      • remote_api:开启

      在 app.yaml 中

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-09-06
        • 1970-01-01
        • 1970-01-01
        • 2017-06-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多