[英]Python 3.5 connection.py: sock.connect(sa) ConnectionRefusedError: [Errno 111]
I have a Python 3.5 script that pulls info from another Linux server.我有一个 Python 3.5 脚本,它从另一个 Linux 服务器中提取信息。 It must first connect through the 443 port to establish a connection.
必须先通过443端口建立连接。 Unfortunately I get the following error message instead:
不幸的是,我收到以下错误消息:
I can ping the Linux server but get the following error:我可以 ping 通 Linux 服务器,但出现以下错误:
Traceback (most recent call last):
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site- packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site- packages/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
self._validate_conn(conn)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 761, in _validate_conn
conn.connect()
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 204, in connect
conn = self._new_conn()
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 134, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 88, in create_connection
raise err
File "/opt/saddlesum/webapp_Py3/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 78, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
The problem was caused by a duplicate IP address in my /etc/hosts files. 问题是由我的/ etc / hosts文件中的IP地址重复引起的。 Once I deleted the incorrect entry everything started working.
删除不正确的条目后,一切便开始起作用。
Hi did you finally solved this issues.您好,您最终解决了这个问题吗? I m having the same trouble.
我有同样的麻烦。
I Set Up a wagatail app with Postgres, Nginx, and Gunicorn on Ubuntu 20. And after the the configurations, here is what I get when I send a message from the contact app.我在 Ubuntu 20 上使用 Postgres、Nginx 和 Gunicorn 设置了一个 wagatail 应用程序。在配置之后,这是我从联系人应用程序发送消息时得到的。
Internal server error Sorry, there seems to be an error.内部服务器错误 抱歉,好像有错误。 Please try again soon.
请稍后重试。
I have sentry running and telling me the errors like this:我有哨兵运行并告诉我这样的错误:
1- ConnectionRefusedError /{var} New Issue Unhandled [Errno 111] Connection refused 1- ConnectionRefusedError /{var} 新问题未处理 [Errno 111] 连接被拒绝
2 - Invalid HTTP_HOST header: '${ip}:${port}'. 2 - 无效的 HTTP_HOST header:'${ip}:${port}'。 The domain name
域名
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.