使用remote_api_shell.py时出错:ssl.SSLError:[Errno 8] _ssl.c:510:EOF违反协议

时间:2015-11-25 00:54:01

标签: google-app-engine google-cloud-datastore google-app-engine-python

我可以通过以下方式使用remote_api_shell.py访问我的Google App Engine应用程序的数据存储区:

remote_api_shell.py -s url/of/server --secure

但是我收到以下错误:

Traceback (most recent call last):
  File "./remote_api_shell.py", line 133, in <module>
    run_file(__file__, globals())
  File "./remote_api_shell.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 160, in <module>
    main(sys.argv)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 156, in main
    oauth2=True)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
    secure=secure)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 768, in ConfigureRemoteApiForOAuth
    rpc_server_factory=rpc_server_factory)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 835, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 245, in Send
    url, method=method, body=payload, headers=headers)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/oauth2client/oauth2client/client.py", line 562, in new_request
    redirections, connection_type)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1584, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1332, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1268, in _conn_request
    conn.connect()
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 1014, in connect
    self.disable_ssl_certificate_validation, self.ca_certs)
  File "/home/vagrant/google-cloud-sdk/platform/google_appengine/lib/httplib2/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/usr/lib/python2.7/ssl.py", line 487, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 243, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 405, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

当我从使用自定义域名切换到my-app-id.appspot.com时,问题就消失了。

其他一些注意事项

  1. 如果您使用的是https,则your-app-id.appspot.com无法开箱即用。您必须在与域名对应的Google Apps页面上启用它。是的,这意味着您实际上必须为该域设置Google Apps。
  2. 如果您有多模块设置,请务必将remote_api: on添加到默认模块的builtins的{​​{1}}部分。或者,如果您有另一个模块的app.yaml,则使用跳过remote-api: on文件的URL并直接定位模块。