1

我正在尝试来自 GAE 的非常简单的“Hello world 程序”,还有一行用于日志记录。

import webapp2
import logging

class MainPage(webapp2.RequestHandler):

    def get(self):
        logging.info('Executing my app.')
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Hello, webapp2 World!')


app = webapp2.WSGIApplication([('/', MainPage)],
                              debug=True)

此示例在部署到 apppot 后运行良好。

但随着开发环境。我可以从日志控制台看到日志,然后总是出现 INK 错误。我试图从不同的例子中复制代码,没有帮助。

我已经检查了 GAE 版本,偏好。一切似乎都很好。任何人都可以帮忙吗?

日志:

 INFO     2013-04-23 08:38:20,326 main.py:8] Executing my app.
 HTTPError()
 HTTPError()
 Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
    self.server.gateway(self).respond()
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 246, in __call__
    return app(environ, start_response)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\request_rewriter.py", line 311, in _rewriter_middleware
    response_body = iter(application(environ, wrapped_start_response))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\request_handler.py", line 89, in __call__
    self._flush_logs(response.get('logs', []))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\request_handler.py", line 220, in _flush_logs
    apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 94, in MakeSyncCall
    return stubmap.MakeSyncCall(service, call, request, response)
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 320, in MakeSyncCall
    rpc.CheckSuccess()
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_rpc.py", line 156, in _WaitImpl
    self.request, self.response)
  File "C:\Program Files\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\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\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 393, in Send
    f = self.opener.open(req)
  File "C:\Python27\lib\urllib2.py", line 406, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: INKApi Error
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
    req.respond()
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
    self.server.gateway(self).respond()
  File "C:\Program Files\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 246, in __call__
    return app(environ, start_response)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\request_rewriter.py", line 311, in _rewriter_middleware
    response_body = iter(application(environ, wrapped_start_response))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\request_handler.py", line 89, in __call__
    self._flush_logs(response.get('logs', []))
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\request_handler.py", line 220, in _flush_logs
    apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 94, in MakeSyncCall
    return stubmap.MakeSyncCall(service, call, request, response)
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_stub_map.py", line 320, in MakeSyncCall
    rpc.CheckSuccess()
  File "C:\Program Files\Google\google_appengine\google\appengine\api\apiproxy_rpc.py", line 156, in _WaitImpl
    self.request, self.response)
  File "C:\Program Files\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\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\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 393, in Send
    f = self.opener.open(req)
  File "C:\Python27\lib\urllib2.py", line 406, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: INKApi Error
INFO     2013-04-23 16:38:22,436 server.py:561] default: "GET / HTTP/1.1" 500 -
4

1 回答 1

0

我遇到了同样的问题 INKApi 错误,来自 erickthered 的答案解决了我的问题:https ://stackoverflow.com/a/19460147/1591720

于 2013-12-05T01:41:30.890 回答