Auto-Scheduler Failed to establish a new connection

my station can’t run auto-scheduling and it always gets a message like this

2021-11-16 10:56:27,126 - auto_scheduler.satnogs_client - INFO - Requesting information for ground station 2394
2021-11-16 10:56:28,601 - auto_scheduler.satnogs_client - INFO - Ground station information retrieved!
2021-11-16 10:56:28,602 - root - INFO - Updating transmitters and TLEs for station
2021-11-16 10:56:28,606 - auto_scheduler.satnogs_client - INFO - Fetching transmitter information from DB.
2021-11-16 10:56:36,019 - auto_scheduler.satnogs_client - INFO - Transmitters received!
2021-11-16 10:56:36,076 - auto_scheduler.satnogs_client - INFO - Transmitters filtered based on ground station capability.
2021-11-16 10:56:36,077 - auto_scheduler.satnogs_client - INFO - Fetching transmitter information from DB.
2021-11-16 10:56:43,500 - auto_scheduler.satnogs_client - INFO - Transmitters received!
2021-11-16 10:56:43,563 - auto_scheduler.satnogs_client - INFO - Transmitters filtered based on ground station capability.
2021-11-16 10:56:43,567 - auto_scheduler.satnogs_client - INFO - Fetching satellite information from DB.
Traceback (most recent call last):
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connection.py", line 175, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen
    chunked=chunked,
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connection.py", line 358, in connect
    conn = self._new_conn()
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0xb5881af0>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 756, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='db.satnogs.org', port=443): Max retries exceeded with url: /api/satellites (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xb5881af0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./schedule_single_station.py", line 340, in <module>
    main()
  File "./schedule_single_station.py", line 187, in main
    cache.update()
  File "/home/pi/satnogs-auto-scheduler/auto_scheduler/cache.py", line 72, in update
    alive_norad_cat_ids = get_satellite_info()
  File "/home/pi/satnogs-auto-scheduler/auto_scheduler/satnogs_client.py", line 32, in get_satellite_info
    r = requests.get('{}/api/satellites'.format(settings.DB_BASE_URL))
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/satnogs-auto-scheduler/env/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='db.satnogs.org', port=443): Max retries exceeded with url: /api/satellites (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xb5881af0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

How to solve it, thank you

Good morning,

This seems to be a network issue OSError: [Errno 101] Network is unreachable and you need to check if the system is able to reach the internet.

The schedular is trying to connect to db.satnogs.org so you should be able to ping the following system:

ping db.satnogs.org the result should be something like:

ping db.satnogs.org
PING srv01.libre.space (94.130.162.100) 56(84) bytes of data.
64 bytes from srv01.libre.space (94.130.162.100): icmp_seq=1 ttl=55 time=20.7 ms
64 bytes from srv01.libre.space (94.130.162.100): icmp_seq=2 ttl=55 time=19.9 ms

--- srv01.libre.space ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 19.919/20.306/20.693/0.387 ms

If this isn’t successful we know that there is something wrong with IP and also possible with DNS.

Then to further debug this issue we need to now more of your setup, the more details the better.

All the best,

Jan PE0SAT