Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection reset by peer with stdlib request #46

Open
ifoche opened this issue May 27, 2020 · 2 comments
Open

Connection reset by peer with stdlib request #46

ifoche opened this issue May 27, 2020 · 2 comments

Comments

@ifoche
Copy link
Member

ifoche commented May 27, 2020

No description provided.

@ifoche
Copy link
Member Author

ifoche commented May 27, 2020

Randomly, it happens sometimes the following error:

[d2-docker:DEBUG] wait_for_server:url=http://localhost:8080
Traceback (most recent call last):
  File "src/d2_docker/cli.py", line 81, in <module>
    sys.exit(main())
  File "src/d2_docker/cli.py", line 74, in main
    return args.func(args)
  File "/home/nacho/EyeSeeTea/code/d2-docker/src/d2_docker/commands/upgrade.py", line 49, in run
    keep_running=keep_running,
  File "/home/nacho/EyeSeeTea/code/d2-docker/src/d2_docker/commands/upgrade.py", line 97, in upgrade_to_version
    if not utils.wait_for_server(final_port):
  File "/home/nacho/EyeSeeTea/code/d2-docker/src/d2_docker/utils.py", line 426, in wait_for_server
    urllib.request.urlopen(url)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 1353, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.6/urllib/request.py", line 1328, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1356, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

Second execution seems to work

@tokland
Copy link
Contributor

tokland commented Sep 17, 2020

I had never seen this error, but clearly ConnectionResetError should be one of the exceptions catched in the wait loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants