3

このエラーについてはすでに多くの投稿があることを理解していますが、少なくとも私の観点からは、私の問題は独特のようです。私が間違っていることを証明してください!私はPython2.7を使用しており、jinja2とdbをインポートしてい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

**デプロイ後のログ出力:

*** 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 ***

--UPDATE--変数の名前付けエラーが発生しましたが、それが解消されたとき、500サーバーエラーは発生しませんでした。スローされたエラーは、通常、この特定のケース以外のものであるため、もう少し説明的であるといいのですが。学んだ教訓-このような状況に陥った場合、それは確かにコードのエラーです。皆様のご協力に感謝いたします。

4

3 に答える 3

8

App Engine 500(内部サーバーエラー)は、ほとんどの場合、Pythonコードがランタイムによってキャッチされた手に負えない例外をスローしたことを意味します。1つをキャッチすると、応答に対して500を返します。

于 2013-03-16T16:34:13.563 に答える
3

Djangoビューで呼び出されたhtmlテンプレートでjsファイルとcssファイルを参照していました。それらのcssファイルとjsファイルは私のアプリには存在しませんでした。ローカルホストで正常に動作しました。しかしserver error 500GAEでは。

App Engineダッシュボードに移動し、エラーを探します-クライアントエラー、サーバーエラー。そこに記載されているcssファイルとjsファイルのエラーが表示されました。これらのエラーは、ターミナルのログを次のように表示しても表示されません。gcloud app logs tail -s default

于 2019-09-15T18:02:09.740 に答える
0

これは、アプリケーションの起動に問題がある場合に発生します。したがって、ログを確認するための最良の方法は、

ログを確認する1つの方法は、開くことです

 App Engine >> Services 

すべてのサービスがリストされているテーブルが表示されるので、[診断]列の下に[ツール]のドロップダウンがあり、ドロップダウンを開いて[ログ]を選択します。

「なぜアプリケーションが起動しないのか」の根本的な原因を見つけることができるかもしれません。

于 2021-07-06T05:06:55.650 に答える