无法连接到WSGI守护进程"wsgi" [英] Unable to connect to WSGI daemon process 'wsgi'

查看:81
本文介绍了无法连接到WSGI守护进程"wsgi"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如之前在多个问题/解答中所强调的,即,我已将WSGISocketPrefix配置为/etc/httpd/run/wsgi

/etc/httpd/run目录具有root:apache权限,创建的文件文件具有apache:root权限.

我面临的问题是,apache总是尝试连接到袜子,这比它要寻找的袜子少了一个.例如,袜子是/var/run/httpd/wsgi.1769.1.1.sock,但是apache查找/var/run/httpd/wsgi.1769.0.1.sock

没有权限问题AFAIK,问题在于WSGI袜子编号apache正在查找.我该如何克服这个问题?为什么wsgi和apache之间的sock-version之间不匹配?

确切的日志行:(2)No such file or directory: [client A.B.C.D:57798] mod_wsgi (pid=1549): Unable to conn ect to WSGI daemon process 'wsgi' on '/etc/httpd/run/wsgi.1144.0.1.sock' after multiple attempts.

解决方案

最可能的原因是您完成了Apache正常重启,并且使用keep alive的客户端连接寿命很长,这使Apache子工作进程保持运行.尝试处理同一连接上的其他请求.该进程将仅尝试连接到创建该进程时存在的守护进程组,但是重新启动意味着该守护进程组已重新启动.由于安全原因,它不能切换到使用守护进程组的新实例,因为配置更改意味着它可能不应该这样做.允许这样做可能会导致安全漏洞.

除了不使用正常重启或为客户端连接保持活动状态外,没有任何减轻它的简单方法.

您多久进行一次正常重启?您在多大程度上依赖与动态Python应用程序保持活动连接?

As highlighted in multiple questions/asnwers before, namely this and this I have configured my WSGISocketPrefix to be /etc/httpd/run/wsgi

/etc/httpd/run directory has permission root:apache and the sock file created has apache:root permission.

The issue I am facing is that apache is always trying to connect to the sock which is one less than what it should be looking for. Example the sock is /var/run/httpd/wsgi.1769.1.1.sock but apache looks for /var/run/httpd/wsgi.1769.0.1.sock

There are no permission issues AFAIK, the problem is with the WSGI sock number apache is looking up. How can I overcome this issue? Why is there a mismatch between sock-version between wsgi and apache?

Exact log line: (2)No such file or directory: [client A.B.C.D:57798] mod_wsgi (pid=1549): Unable to conn ect to WSGI daemon process 'wsgi' on '/etc/httpd/run/wsgi.1144.0.1.sock' after multiple attempts.

解决方案

Most likely because you have done an Apache graceful restart and there was a long lived client connection using keep alive which has kept the Apache child worker process running, with it trying to handle further requests on same connection. That process will only try and connect to the daemon process group as it existed when that process was created, but the restart meant the daemon process group got restarted. It cannot switch to using new instance of daemon process group for security reasons as configuration changes meant that perhaps it shouldn't be doing that. To allow it could cause security breach.

There is no simple way to mitigate it except to not use graceful restarts, or turn of keep alive for client connections.

How often are you doing graceful restarts? How heavily are you dependent on keep alive connections against your dynamic Python applications?

这篇关于无法连接到WSGI守护进程"wsgi"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆