获取错误504:网关在开发服务器中超时

时间:2013-10-07 14:13:19

标签: google-app-engine

我一直在为我的python应用引擎开发服务器上的504错误而苦苦挣扎。 我是公司代理的后面但通常设置HTTP_PROXY和HTTPS_PROXY没有问题,我不知道它是否与我的问题有关。

在我的代码中,我使用apiclient中的发现(main.py第63行)

driveService = discovery.build("drive", "v2", http=http)

执行此操作时,我会得到以下追溯

INFO     2013-10-07 13:49:42,812 discovery.py:190] URL being requested: https://www.googleapis.com/discovery/v1/apis/drive/v2/rest?userIp=%3A%3A1
ERROR    2013-10-07 13:49:55,848 wsgi.py:262]
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 239, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 298, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 84, in LoadObject
    obj = __import__(path[0])
  File "c:\temp\iterlex-backend\main.py", line 63, in <module>
    driveService = discovery.build("drive", "v2", http=http)
  File "c:\temp\iterlex-backend\oauth2client\util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "c:\temp\iterlex-backend\apiclient\discovery.py", line 192, in build
    resp, content = http.request(requested_url)
  File "c:\temp\iterlex-backend\httplib2\__init__.py", line 1464, in request
    cached_value = self.cache.get(cachekey)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\memcache\__init__.py", line 559, in get
    results = rpc.get_result()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 612, in  get_result
    return self.__get_result_hook(self)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\memcache\__init__.py", line 615, in __get_hook
    rpc.check_success()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 578, in check_success
    self.__rpc.CheckSuccess()
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_rpc.py", line 156, in _WaitImpl
    self.request, self.response)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 200, in MakeSyncCall
    self._MakeRealSyncCall(service, call, request, response)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 226, in _MakeRealSyncCall
    encoded_response = self._server.Send(self._path, encoded_request)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 393, in Send
    f = self.opener.open(req)
  File "C:\tools\Python27\lib\urllib2.py", line 397, in open
    response = meth(req, response)
  File "C:\tools\Python27\lib\urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\tools\Python27\lib\urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "C:\tools\Python27\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "C:\tools\Python27\lib\urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 504: Gateway Time-out
HTTPError()

如果我在相同的控制台窗口中尝试使用curl的违规URL,它可以工作(我必须使用-k选项)

C:\temp> curl -k https://www.googleapis.com/discovery/v1/apis/drive/v2/rest?userIp=%3A%3A1
{
 "kind": "discovery#restDescription",
 "etag": "\"XflbyoTZtBo225MnsgwJQ-FHlhA/AFnpisGyT0XxOrZz7gMWdR5PpRg\"",
...

对app引擎和python不熟悉,我承认我有点迷失,任何帮助都会非常感激

谢谢! 尼古拉斯

0 个答案:

没有答案