我在开始使用GAE(使用Python 2.7的OS X 10.6.8上的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上找到这个文件。而且,为了让代码上传我似乎迟钝了d必须删除cacert文本文件。但也许我是个白痴。
我在这里遇到的另一个问题是,由于管理python版本的难度,OS X与GAE不兼容。在安装了python,EPD,ActiveState,MacPorts的多个版本后,我手上已经弄得一团糟了。尽管他们愿意,但这些都没有解决我早期的问题。这是谷歌应用程序管理的状态真的很可怕。看起来GAE是由一群来自90年代中期微软的人建造的......对于上述问题的任何建议都将非常感激。干杯
答案 0 :(得分:1)
错误结束后的第四行。链接下的相关说明。
http://code.google.com/appengine/kb/general.html#rpcssl
确保(来自文档):
To do this you must have the ssl Python module installed on your system.
答案 1 :(得分:0)
解决方法:运行--skip_sdk_update_check=yes
时使用命令行参数dev_appserver.py
。
我遇到了同样的问题,并注意到每次启动应用时,GUI工具(GoogleAppEngineLauncher)都会使用--skip_sdk_update_check=yes
。这是SDK 1.8.7。
根本原因似乎是GAE开发服务器模块whiltelisting系统中的known bug。即使您安装了ssl
模块(正如文档中所述),ssl
也依赖于_ssl
,而import ssl
未列入白名单。这就是为什么你可以在常规的python shell会话中执行{{1}}而没有问题,但是当你在GAE应用程序中执行相同的行时会出错。