2013-03-27 84 views
3

我在开始使用GAE(OS X 10.6.8上的1.7.6与Python 2.7)时遇到了问题,并且与亚马逊服务相比,它很糟糕。不过,我想至少要部署示例应用程序。在完成其他问题之后,我现在已经准备好部署一个小型示例应用程序。当我尝试部署,我收到SSL错误如下:Google App Engine上的SSL证书

*** Running appcfg.py with the following flags: 
    --no_cookies [email protected] --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文本文件。但也许我是个白痴。

我在这里面临的另一个问题是OS X由于难以管理python版本而不能很好地与GAE配合使用。在安装了多个版本的python,EPD,ActiveState,MacPorts之后,我现在手头一团糟。尽管有保证,但这些解决方案都不能解决我早期的问题。这真是非常可怕,这是谷歌的应用程序管理状态。它看起来像GAE是由90年代中期微软的一群人建造的......任何关于上述问题的建议都将不胜感激。欢呼声

回答

1

从错误结束的第四行。链接下的相关说明。

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

确保(从文件):

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

0

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


我有同样的问题,并注意到了GUI工具(GoogleAppEngineLauncher)使用--skip_sdk_update_check=yes每次启动一个应用程序的时间。这是SDK 1.8.7的。

在GAE开发服务器的模块系统中,根本原因似乎是known bug。即使您安装了ssl模块(因为文档中说明是必需的),ssl依赖于未列入白名单的_ssl。这就是为什么你可以在正常的python shell会话中执行import ssl而没有问题,但是当你在GAE应用程序中执行同一行时会出错。