【问题标题】:Python script is failing with ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))Python 脚本因 ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) 而失败
【发布时间】:2021-12-16 13:12:03
【问题描述】:

我和你们中的许多人都有类似的问题,但无法解决。我正在生成一个在我的 VirtualBox Linux 7.3 和 7.9 上运行良好的自执行文件,但是当我尝试在其他地方(在其他 Linux 服务器上)运行它时,我得到以下输出:

  Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 706, in urlopen
  File "urllib3/connectionpool.py", line 382, in _make_request
  File "urllib3/connectionpool.py", line 1010, in _validate_conn
  File "urllib3/connection.py", line 421, in connect
  File "urllib3/util/ssl_.py", line 429, in ssl_wrap_socket
  File "urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
  File "ssl.py", line 365, in wrap_socket
  File "ssl.py", line 776, in __init__
  File "ssl.py", line 1036, in do_handshake
  File "ssl.py", line 648, in do_handshake
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 756, in urlopen
  File "urllib3/util/retry.py", line 532, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 706, in urlopen
  File "urllib3/connectionpool.py", line 382, in _make_request
  File "urllib3/connectionpool.py", line 1010, in _validate_conn
  File "urllib3/connection.py", line 421, in connect
  File "urllib3/util/ssl_.py", line 429, in ssl_wrap_socket
  File "urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
  File "ssl.py", line 365, in wrap_socket
  File "ssl.py", line 776, in __init__
  File "ssl.py", line 1036, in do_handshake
  File "ssl.py", line 648, in do_handshake
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "create_incident.py", line 415, in <module>
    open_incident_ticket()
  File "create_incident.py", line 368, in open_incident_ticket
    resp = requests.post(endpoint_uri, headers=headers, data = json.dumps(data))
  File "requests/api.py", line 119, in post
  File "requests/api.py", line 61, in request
  File "requests/sessions.py", line 542, in request
  File "requests/sessions.py", line 655, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

我的帖子构造函数看起来像:

resp = requests.post(endpoint_uri, headers=headers, data = json.dumps(data))

你能告诉我我需要在哪里寻找它吗?我是否有多个问题正在努力解决? 非常感谢, 马里奥

【问题讨论】:

    标签: python python-3.x rest ssl python-jsons


    【解决方案1】:

    最终,问题是由防火墙设置引起的。

    【讨论】:

    • 您能分享一下是什么设置导致了这个问题吗?我有同样的问题。
    • ^ OP 好吗????
    猜你喜欢
    • 2019-02-02
    • 2019-04-30
    • 2019-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-15
    • 1970-01-01
    • 2016-06-21
    相关资源
    最近更新 更多