【问题标题】:500 Server Error on Google App Engine, no clue whyGoogle App Engine 上的 500 服务器错误,不知道为什么
【发布时间】:2013-06-03 06:57:05
【问题描述】:

在部署在本地运行良好的 web 应用时,我一直收到 500 错误...

Error: Server Error

The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.

除了我的应用已成功部署之外,日志没有告诉我任何其他信息...

11:50 PM Host: appengine.google.com
11:50 PM Application: suraj-kapoor; version: 1
11:50 PM 
Starting update of app: suraj-kapoor, version: 1
11:50 PM Getting current resource limits.
11:50 PM Scanning files on local disk.
11:50 PM Cloning 2 static files.
11:50 PM Cloning 6 application files.
11:50 PM Uploading 1 files and blobs.
11:50 PM Uploaded 1 files and blobs
11:50 PM Compilation starting.
11:50 PM Compilation completed.
11:50 PM Starting deployment.
11:50 PM Checking if deployment succeeded.
11:50 PM Deployment successful.
11:50 PM Checking if updated app version is serving.
11:50 PM Completed update of app: suraj-kapoor, version: 1
11:50 PM Uploading index definitions.
Password for suraj@looklab.com: 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 0 ***

这里是控制台日志。请注意,PIL 警告是标准警告。我确实将 PIL 模块导入我的应用程序以防万一,但它没有任何效果......

*** Running dev_appserver with the following flags:
    --skip_sdk_update_check=yes --port=14080 --admin_port=8006
Python command: /usr/bin/python2.7
INFO     2013-06-07 14:52:57,048 devappserver2.py:522] Skipping SDK update check.
WARNING  2013-06-07 14:52:57,086 api_server.py:329] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO     2013-06-07 14:52:57,109 api_server.py:153] Starting API server at: http://localhost:57543
INFO     2013-06-07 14:52:57,115 dispatcher.py:164] Starting server "default" running at: http://localhost:14080
INFO     2013-06-07 14:52:57,127 admin_server.py:117] Starting admin server at: http://localhost:8006

我的 app.yaml 看起来还不错...

application: suraj-kapoor
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /static
  static_dir: static

- url: .*
  script: main.app

libraries:
- name: jinja2
  version: latest
- name: webapp2
  version: "2.5.2" 

Web 应用程序使用 JSON 从 Instagram 的 API 中提取图像,如果可以的话。我完全不知道为什么会出现这个错误!

这是实时日志...

2013-06-07 08:34:21.516 /favicon.ico 500 11ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36
199.47.72.170 - - [07/Jun/2013:08:34:21 -0700] "GET /favicon.ico HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" "suraj-kapoor.appspot.com" ms=12 cpu_ms=0 app_engine_release=1.8.0 instance=00c61b117c22c59d63580abdad0f481f2f485295
E 2013-06-07 08:34:21.515
Traceback (most recent call last):
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 196, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 255, in _LoadHandler
    handler = __import__(path[0])
  File "/base/data/home/apps/s~suraj-kapoor/1.367922706590908179/main.py", line 7, in <module>
    import requests
ImportError: No module named requests

【问题讨论】:

  • 您需要显示 App Engine 管理控制台日志中的实际内容。您只显示了终端中的日志,这没有帮助。
  • @DanielRoseman 我已将日志添加到原始问题中。谢谢。
  • 对不起,我完全不明白。您现在已经发布了您的开发服务器日志。但是您特别指出问题是在部署站点后运行该站点。为什么不显示来自实时服务器的日志?
  • @DanielRoseman 道歉我对这一切都很陌生。我想我找到了实时日志(我什至不知道它存在!),它在请求模块中引发了一个错误,该模块在应用程序中运行良好。
  • 原来GAE不支持requests库。

标签: google-app-engine python-2.7


【解决方案1】:

我有一个案例,一个完全损坏的 app.yaml 在 dev 上运行良好(如何?!)但在“生产”上立即给出 500,但日志中没有任何类型的详细信息。因此,请检查您的 app.yaml(可能还有 index.yaml 等)是否存在语法错误或类似错误。

【讨论】:

    【解决方案2】:

    【讨论】:

      【解决方案3】:

      有时 500 确实是由 Google 基础架构造成的。当他们可以检测到 在这种情况下,它应该将用户引导到更具体的支持页面。一般 Google 支持页面对于报告和应用引擎中断毫无用处。

      【讨论】:

      • 是的,我同意,这就像大海捞针。
      猜你喜欢
      • 1970-01-01
      • 2020-02-20
      • 1970-01-01
      • 2012-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多