daniestevez / gr-satellites

GNU Radio decoder for Amateur satellites
GNU General Public License v3.0
776 stars 161 forks source link

running gr_satellites SMOG-1 --udp --samp_rate 48e3 fails to create connection in urllib3 #541

Closed chrisjohgorman closed 7 months ago

chrisjohgorman commented 7 months ago
$ gr_satellites SMOG-1 --udp --samp_rate 48e3
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/usr/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 404, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1058, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect
    self.sock = conn = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x733c8616a910>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='gnd.bme.hu', port=8080): Max retries exceeded with url: /api/tokens (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x733c8616a910>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/gr_satellites", line 322, in <module>
    main()
  File "/usr/bin/gr_satellites", line 307, in main
    tb = gr_satellites_top_block(parser)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/gr_satellites", line 196, in __init__
    self.flowgraph = satellites.core.gr_satellites_flowgraph(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/satellites/core/gr_satellites_flowgraph.py", line 147, in __init__
    self._init_additional_datasinks()
  File "/usr/lib/python3.11/site-packages/satellites/core/gr_satellites_flowgraph.py", line 222, in _init_additional_datasinks
    self.get_telemetry_submitters(self.satyaml, self.config,
  File "/usr/lib/python3.11/site-packages/satellites/core/gr_satellites_flowgraph.py", line 349, in get_telemetry_submitters
    submitters.append(datasinks.telemetry_submit(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/satellites/components/datasinks/telemetry_submit.py", line 66, in __init__
    self.submit = bme_submitter(
                  ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/satellites/bme_submitter.py", line 33, in __init__
    self.authenticate(user, password)
  File "/usr/lib/python3.11/site-packages/satellites/bme_submitter.py", line 40, in authenticate
    rauth = requests.post(
            ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='gnd.bme.hu', port=8080): Max retries exceeded with url: /api/tokens (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x733c8616a910>: Failed to establish a new connection: [Errno 111] Connection refused'))

My gr_satellites version is ...

$ gr_satellites --version
gr_satellites v5.6.0-git
Copyright (C) 2020 Daniel Estevez
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

And I am running under Arch Linux. (Although the same result occurs with Ubuntu 23.10.) Have I found a bug, or did I miss use gr_satellites? Thanks in advance.

daniestevez commented 7 months ago

Thanks for reporting. This is a bug. The problem is that if telemetry submission is enabled, gr_satellites tries to authenticate to the BME telemetry server at https://gnd.bme.hu:8080. This server is not active at the moment (I'm not sure if it will ever become operational again), so the connection fails. I have fixed this bug by making this not a fatal error. The bug fix is now in the main branch. A workaround for older versions of gr-satellites is to disable telemetry submission in $HOME/.gr_satellites/config.ini.