部署后 AppEngine 500 服务器错误 - 代码错误?

ndi*_*vol 3 google-app-engine

我知道已经有很多关于这个错误的帖子,但我的问题似乎是独一无二的,至少从我的角度来看。请证明我错了!我正在使用 Python 2.7,通过from google.appengine.ext import db. 我的其他不导入这些包的更简单的应用程序部署得很好,但是这个会抛出一个Error: Server Error. 这可能与我的代码有关,还是 Google 的问题?似乎这是当今常见的错误,但似乎也有很多诊断。但是,由于我的一些应用程序部署而不是其他应用程序,这很可疑。谢谢。

——一些额外的信息——

正如我在评论中所说,本地运行正常,部署会引发服务器错误。

**本地运行后的日志输出:

*** Running dev_appserver with the following flags: --admin_console_server= --port=8080
Python command: /usr/local/bin/python2.7
WARNING  2013-03-17 03:06:52,527 dev_appserver.py:3578] The datastore file stub is 
deprecated, and will stop being the default in a future release.
Append the --use_sqlite flag to use the new SQLite stub.

You can port your existing data using the --port_sqlite_data flag or
purge your previous test data with --clear_datastore.

WARNING  2013-03-17 03:06:52,550 dev_appserver.py:3682] Could not initialize images API;
you are likely missing the Python "PIL" module. ImportError: No module named _imaging
INFO     2013-03-17 03:06:52,572 dev_appserver_multiprocess.py:656] Running application
dev~app1 on port 8080: http://localhost:8080
INFO     2013-03-17 03:06:52,572 dev_appserver_multiprocess.py:658] Admin console is
available at: http://localhost:8080/_ah/admin
Run Code Online (Sandbox Code Playgroud)

**部署后的日志输出:

*** Running appcfg.py with the following flags:
--no_cookies --email=***@gmail.com --passin update
08:02 PM Host: appengine.google.com
08:02 PM Application: app1; version: 1
08:02 PM 
Starting update of app: app1, version: 1
08:02 PM Getting current resource limits.
08:02 PM Scanning files on local disk.
08:02 PM Cloning 1 static file.
08:02 PM Cloning 4 application files.
08:02 PM Compilation starting.
08:02 PM Compilation completed.
08:02 PM Starting deployment.
08:02 PM Checking if deployment succeeded.
08:02 PM Deployment successful.
08:02 PM Checking if updated app version is serving.
08:02 PM Completed update of app: app1, version: 1
Password for ***@gmail.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 ***
Run Code Online (Sandbox Code Playgroud)

--UPDATE-- 原来我有一个变量命名错误,当它被清除时,不再有 500 服务器错误。我希望抛出的错误更具解释性,因为它们通常是除了这种特殊情况之外的。吸取的教训——如果你发现自己处于这种情况,那肯定是你的代码中的一个错误。谢谢大家的帮助。

Lin*_*ios 7

App Engine 500(内部服务器错误)几乎总是意味着您的 Python 代码抛出了一个由运行时捕获的未经处理的异常。当它捕获到一个时,它会为响应返回 500。


Ase*_*eem 6

我在 Django 视图中调用的 html 模板中引用了 js 和 css 文件。我的应用程序中不存在这些 css 和 js 文件。在本地主机上运行良好。但server error 500在GAE上。

进入 App Engine 仪表板并查找错误 - 客户端错误、服务器错误。我看到那里提到了我的 css 和 js 文件错误。当您在终端中查看日志时,这些错误不会显示gcloud app logs tail -s default