michaelhball/discogs_alert

Stacktrace when launching

Closed this issue · 1 comments

I tried to run discogs-alert both on Mac Mojave 10.14.6 and Debian 11, using python 3.9.2 and 3.9.6.
In both cases the stacktrace output is as follows:

python3 -m discogs_alert -dt XXXXXXXXXXXXXXXXXXXXXXXX -pt XXXXXXXXXXXXXXXXXXXXXXXX -wp path

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x10f1c3610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.ratesapi.io', port=443): Max retries exceeded with url: /api/latest?base=EUR (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10f1c3610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discogs_alert/main.py", line 70, in
main()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discogs_alert/main.py", line 65, in main
schedule.run_pending()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/schedule/init.py", line 563, in run_pending
default_scheduler.run_pending()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/schedule/init.py", line 94, in run_pending
self._run_job(job)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/schedule/init.py", line 147, in _run_job
ret = job.run()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/schedule/init.py", line 466, in run
ret = self.job_func()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discogs_alert/main.py", line 63, in
schedule.every(int(60 / frequency)).minutes.do(lambda: loop(*args))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discogs_alert/loop.py", line 22, in loop
currency_rates = get_currency_rates(currency)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/discogs_alert/utils.py", line 57, in get_currency_rates
return requests.get(f'https://api.ratesapi.io/api/latest?base={base_currency}').json().get('rates')
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.ratesapi.io', port=443): Max retries exceeded with url: /api/latest?base=EUR (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10f1c3610>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

Hi! A 3rd party API we were using to handle currency exchange had closed down, hence the connection error. The latest version (0.0.6) now includes a fix, so you should be good to go once you upgrade. Let me know if things still don't work for you, otherwise I'll close the issue