现在的位置: 首页 > 综合 > 正文

GAE部署时urllib2.py错误解决办法

2013年03月02日 ⁄ 综合 ⁄ 共 3025字 ⁄ 字号 评论关闭

Google App Engine Launcher出问题,点击 Deploy 后却发现不能正常工作啦,囧啊,报的错误如下:

 2010-06-16 16:32:27,427 ERROR appcfg.py:1568 An unexpected error occurred. Aborting.
Traceback (most recent call last):
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 1535, in DoUpload
    missing_files = self.Begin()
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 1305, in Begin
    version=self.version, payload=self.config.ToYAML())
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appengine_rpc.py", line 346, in Send
    f = self.opener.open(req)
  File "C:/Python25/lib/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "C:/Python25/lib/urllib2.py", line 399, in _open
    '_open', req)
  File "C:/Python25/lib/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "C:/Python25/lib/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:/Python25/lib/urllib2.py", line 1082, in do_open
    raise URLError(err)
URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>
Traceback (most recent call last):
  File "C:/Program Files/Google/google_appengine/appcfg.py", line 68, in <module>
    run_file(__file__, globals())
  File "C:/Program Files/Google/google_appengine/appcfg.py", line 64, in run_file
    execfile(script_path, globals_)
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 2757, in <module>
    main(sys.argv)
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 2748, in main
    result = AppCfgApp(argv).Run()
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 1763, in Run
    self.action(self)
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 2619, in __call__
    return method()
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 2070, in Update
    lambda path: open(os.path.join(basepath, path), 'rb'))
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 1535, in DoUpload
    missing_files = self.Begin()
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appcfg.py", line 1305, in Begin
    version=self.version, payload=self.config.ToYAML())
  File "C:/Program Files/Google/google_appengine/google/appengine/tools/appengine_rpc.py", line 346, in Send
    f = self.opener.open(req)
  File "C:/Python25/lib/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "C:/Python25/lib/urllib2.py", line 399, in _open
    '_open', req)
  File "C:/Python25/lib/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "C:/Python25/lib/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:/Python25/lib/urllib2.py", line 1082, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>
2010-06-16 16:32:27 (Process exited with code 1)

 

是因为https://appengine.google.com/被和谐了所以上传不了。

解决办法如下:

1、在命令行执行:
set HTTP_PROXY=http://google.cn:80
set HTTPS_PROXY=http://google.cn:80
appcfg.py update 你的app文件夹
可以成功上传。

2、命令行上传方式的解决方法为
appcfg.py --insecure update project
就是加入 --insecure 参数

 

抱歉!评论已关闭.