3

我在开始使用 GAE(OS X 10.6.8 和 Python 2.7 上的 1.7.6)时遇到问题,与亚马逊服务相比,它非常糟糕。但是,我想至少部署示例应用程序。在解决了其他问题之后,我现在准备好部署一个小型示例应用程序。当我尝试部署它时,我收到如下 SSL 错误:

 *** Running appcfg.py with the following flags:
    --no_cookies --email=mathsboy@gmail.com --passin update
02:15 PM Host: appengine.google.com
02:15 PM Application: tew-helloworld; version: 1
Traceback (most recent call last):
  File "google_appengine/appcfg.py", line 171, in <module>
    run_file(__file__, globals())
  File "google_appengine/appcfg.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/appcfg.py", line 4155, in <module>
    main(sys.argv)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 4146, 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 2334, in Run
    self.action(self)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3881, in __call__
    return method()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2892, in Update
    updatecheck.CheckForUpdates()
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/sdk_update_checker.py", line 258, in CheckForUpdates
    runtime=runtime))
  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 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1207, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 383, in do_open
    url_error.reason.args[1])
fancy_urllib.InvalidCertificateException: Host appengine.google.com returned an invalid certificate (_ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed): 
To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***

在另一个线程中对此有一些建议,指出您需要删除 cacerts.txt,尽管我无法在 OS X 上找到此文件。此外,为了上传代码,我必须删除一个 cacert 文本文件。但也许我是个白痴。

我在这里面临的另一个问题是,由于管理 python 版本的困难,OS X 不能很好地与 GAE 一起工作。在安装了多个版本的 python、EPD、ActiveState、MacPorts 之后,我现在手头一团糟。尽管有保证,但这些都不能解决我早期的问题。这真是谷歌应用管理的状态,实在是太骇人听闻了。看起来 GAE 似乎是由一群来自 90 年代中期微软的人构建的......任何关于上述问题的建议将不胜感激。干杯

4

2 回答 2

1

错误中的第四行。链接下的相关说明。

http://code.google.com/appengine/kb/general.html#rpcssl

确保(来自文档):

To do this you must have the ssl Python module installed on your system.

于 2013-03-27T08:38:18.770 回答
0

解决方法--skip_sdk_update_check=yes:运行时使用命令行参数dev_appserver.py


我遇到了同样的问题,并注意到--skip_sdk_update_check=yes每次启动应用程序时都会使用 GUI 工具 (GoogleAppEngineLauncher)。这是从 SDK 1.8.7 开始的。

根本原因似乎是GAE 开发服务器的模块白名单系统中的一个已知错误。即使您安装了ssl模块(如文档所述是必需的),也ssl依赖于_ssl未列入白名单的模块。这就是为什么您可以import ssl毫无问题地在常规 python shell 会话中执行,但在 GAE 应用程序中执行同一行时会出错。

于 2013-11-13T06:31:08.250 回答