test: failure in rpc_getdescriptorinfo.py (OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted) #25765

issue fanquake openend this issue on August 1, 2022
  1. fanquake commented at 2:22 pm on August 1, 2022: member

    https://cirrus-ci.com/task/5258208494223360:

     0238/246 - rpc_getdescriptorinfo.py failed, Duration: 1 s
     1stdout:
     22022-08-01T13:12:51.831000Z TestFramework (INFO): Initializing test directory C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20220801_121834\rpc_getdescriptorinfo_6
     32022-08-01T13:12:52.490000Z TestFramework (ERROR): Unexpected exception caught during testing
     4Traceback (most recent call last):
     5  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\test_framework.py", line 133, in main
     6    self.run_test()
     7  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\rpc_getdescriptorinfo.py", line 38, in run_test
     8    self.test_desc('pkh(02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5)', isrange=False, issolvable=True, hasprivatekeys=False)
     9  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\rpc_getdescriptorinfo.py", line 23, in test_desc
    10    info = self.nodes[0].getdescriptorinfo(desc)
    11  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\coverage.py", line 49, in __call__
    12    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    13  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\authproxy.py", line 142, in __call__
    14    response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
    15  File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\authproxy.py", line 107, in _request
    16    self.__conn.request(method, path, postdata, headers)
    17  File "C:\Python39\lib\http\client.py", line 1257, in request
    18    self._send_request(method, url, body, headers, encode_chunked)
    19  File "C:\Python39\lib\http\client.py", line 1303, in _send_request
    20    self.endheaders(body, encode_chunked=encode_chunked)
    21  File "C:\Python39\lib\http\client.py", line 1252, in endheaders
    22    self._send_output(message_body, encode_chunked=encode_chunked)
    23  File "C:\Python39\lib\http\client.py", line 1012, in _send_output
    24    self.send(msg)
    25  File "C:\Python39\lib\http\client.py", line 952, in send
    26    self.connect()
    27  File "C:\Python39\lib\http\client.py", line 923, in connect
    28    self.sock = self._create_connection(
    29  File "C:\Python39\lib\socket.py", line 843, in create_connection
    30    raise err
    31  File "C:\Python39\lib\socket.py", line 831, in create_connection
    32    sock.connect(sa)
    33OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted
    342022-08-01T13:12:52.568000Z TestFramework (INFO): Stopping nodes
    
  2. fanquake added the label Bug on Aug 1, 2022
  3. fanquake added the label Windows on Aug 1, 2022
  4. fanquake added the label Tests on Aug 1, 2022
  5. maflcko commented at 2:27 pm on August 1, 2022: member
    OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted is unrelated to the this test being run. It happens on windows all the time.
  6. fanquake commented at 2:29 pm on August 1, 2022: member
  7. maflcko commented at 2:31 pm on August 1, 2022: member
    I think that only lowers the probability, but it still happens
  8. fanquake commented at 10:22 am on August 10, 2022: member

    Shouldn’t it be getting worked around by this: @sipsorcery any chance you can weigh in here? Can we improve this workaround in some way?

  9. sipsorcery commented at 8:20 pm on August 10, 2022: member

    @sipsorcery any chance you can weigh in here? Can we improve this workaround in some way?

    I have dealt with socket address in use problems on Windows in the past (the SIP prefix in sipsorcery refers to the communications signalling protocol). The problem I had was TCP sockets not closing DESPITE correctly calling the socket close/shutdown methods and even closing the owning process. Windows seems to ang on to the socket entry in some internal table and prevent the same, or a new, process from being able to reuse it for varying amounts of time (I recall it being up to 2 minutes but am probably wrong).

    The approach I used, and that is still used in my SIP library today is to set the SO_REUSEADDR on TCP sockets that rely on a well known port.

    I haven’t looked at the code for the test mentioned in this issue, and wouldn’t know how to set socket options in Python, but if it’s easy to do it may be worth setting that socket option. It could cause other problems, if multiple tests are actually attempting to use the same socket, but if that was the case it should result in the same error on other OS’s as well.

  10. maflcko added the label CI failed on Jan 24, 2024
  11. DrahtBot renamed this:
    test: failure in rpc_getdescriptorinfo.py
    test: failure in rpc_getdescriptorinfo.py (OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted)
    on Jan 24, 2024
  12. maflcko commented at 8:42 am on July 4, 2024: member
    Is this still an issue? Haven’t seen this in a while, I think.
  13. maflcko commented at 8:42 am on July 4, 2024: member
    Closing for now.
  14. maflcko closed this on Jul 4, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me