2017-09-28 6 views
2

webappはEC2にデプロイされており、その後のエラーはランダムに発生します1日に1〜2回ウェブアプリケーションを一定期間アクセスできない状態にします。しばらくすると自動的に修正されます。このファイルまたはディレクトリはありません:mod_wsgi: '/var/run/apache2/wsgi.30303.0.1.sock'のWSGIデーモンプロセス 'web2py'に接続できません

(2)No such file or directory: [client xxx.xx.xx.xxx:xxxxx] mod_wsgi (pid=xxxxx): Unable to connect to WSGI daemon process 'web2py' on '/var/run/apache2/wsgi.30303.0.1.sock'. 

アプリケーションスタック web2pyの のmod_wsgi Apache2の

ログは、エラーの前に毎回異なります

[Thu Sep 28 06:25:01.528334 2017] [mpm_event:notice] [pid 30303:tid 140438078609280] AH00493: SIGUSR1 received. Doing graceful restart 
[Thu Sep 28 06:25:02.318551 2017] [ssl:warn] [pid 30303:tid 140438078609280] AH01906: ip-172-31-0-91.eu-west-1.compute.internal:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?) 
[Thu Sep 28 06:25:02.318574 2017] [ssl:warn] [pid 30303:tid 140438078609280] AH01909: ip-172-31-0-91.eu-west-1.compute.internal:443:0 server certificate does NOT include an ID which matches the server name 
[Thu Sep 28 06:25:02.318664 2017] [wsgi:warn] [pid 30303:tid 140438078609280] mod_wsgi: Compiled for Python/2.7.11. 
[Thu Sep 28 06:25:02.318669 2017] [wsgi:warn] [pid 30303:tid 140438078609280] mod_wsgi: Runtime using Python/2.7.12. 
[Thu Sep 28 06:25:02.319205 2017] [mpm_event:notice] [pid 30303:tid 140438078609280] AH00489: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g mod_wsgi/4.3.0 Python/2.7.12 configured -- resuming normal operations 
[Thu Sep 28 06:25:02.319225 2017] [core:notice] [pid 30303:tid 140438078609280] AH00094: Command line: '/usr/sbin/apache2' 
[Thu Sep 28 06:25:09.327495 2017] [mpm_event:error] [pid 30303:tid 140438078609280] AH00485: scoreboard is full, not at MaxRequestWorkers 
[Thu Sep 28 06:28:39.560285 2017] [mpm_event:error] [pid 30303:tid 140438078609280] AH00485: scoreboard is full, not at MaxRequestWorkers 
[Thu Sep 28 06:45:27.583870 2017] [wsgi:error] [pid 30307:tid 140437629064960] (2)No such file or directory: [client 172.31.32.163:24210] mod_wsgi (pid=30307): Unable to connect to WSGI daemon process 'web2py' on '/var/run/apache2/wsgi.30303.0.1.sock'. 
[Thu Sep 28 06:49:14.503732 2017] [wsgi:error] [pid 30307:tid 140437603886848] (2)No such file or directory: [client 172.31.14.173:37726] mod_wsgi (pid=30307): Unable to connect to WSGI daemon process 'web2py' on '/var/run/apache2/wsgi.30303.0.1.sock'. 

は、より多くの情報が必要な場合、私に教えてください。

答えて

1

これは、HTTPクライアントがキープアライブ接続を使用していて、同じ接続で複数の要求を発行しているときに、Apacheを正常に再起動することによって発生します。

問題は、Apacheがmod_wsgiデーモンプロセスを管理する方法が、グレースフルリスタートであってもすぐにシャットダウンするということです。その間、最初にリクエストを受け入れ、mod_wsgiデーモンプロセスにプロキシするApache子ワーカープロセスは、すべてのクライアント接続が切断されるまで実行を継続します。これは、アライブ接続を維持し、同じクライアント接続を介してWSGIアプリケーションに移動する必要がある場合、mod_wsgiデーモンプロセスの以前のインカネーションがなくなったために失敗することを意味します。

この状況では、再起動の理由が設定変更であり、古い子ワーカープロセスがデーモンの新しいインスタンスに接続できるように、古いApache子ワーカープロセスが新しいmod_wsgiデーモンプロセスに接続することを許可できません新しい構成の下でそのような方法で処理される要求が許可されていない場合、セキュリティ上の問題が発生する可能性があります。

これはまれなシナリオです。セキュリティ上の問題が発生する可能性は低いです。 mod_wsgiの新しいオプションを検討して、この場合は新しいデーモンプロセスに接続しても問題ないと言い、再起動時にデーモンプロセスのリスナーソケットを回転させないと言うのはおそらく合理的です。

この問題が起こっていることは(10年)にわたって知られていましたが、GitHubでmod_wsgiに対して問題が発生しているため、このようなオプションを検討しています。

関連する問題