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

CurrencyRate ends with exception #561

Closed
urza opened this issue Jun 17, 2024 · 3 comments
Closed

CurrencyRate ends with exception #561

urza opened this issue Jun 17, 2024 · 3 comments

Comments

@urza
Copy link

urza commented Jun 17, 2024

First I tried currencyrates USD and that worked, then I tried currencyrates CZK which ends with error.

cln currencyrates CZK
{
   "code": -32600,
   "message": "Error while processing currencyrates: HTTPSConnectionPool(host='www.bitstamp.net', port=443): Max retries exceeded with url: /api/v2/ticker/btcczk/ (Caused by ResponseError('too many 404 error responses'))",
   "traceback": "urllib3.exceptions.ResponseError: too many 404 error responses\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/requests/adapters.py\", line 564, in send\n    resp = conn.urlopen(\n           ^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 948, in urlopen\n    return self.urlopen(\n           ^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 948, in urlopen\n    return self.urlopen(\n           ^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 948, in urlopen\n    return self.urlopen(\n           ^^^^^^^^^^^^^\n  [Previous line repeated 2 more times]\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/urllib3/connectionpool.py\", line 938, in urlopen\n    retries = retries.increment(method, url, response=response, _pool=self)\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/urllib3/util/retry.py\", line 515, in increment\n    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]\n    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nurllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.bitstamp.net', port=443): Max retries exceeded with url: /api/v2/ticker/btcczk/ (Caused by ResponseError('too many 404 error responses'))\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/pyln/client/plugin.py\", line 646, in _dispatch_request\n    result = self._exec_func(method.func, request)\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/pyln/client/plugin.py\", line 623, in _exec_func\n    ret = func(*ba.args, **ba.kwargs)\n          ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.lightning/plugins/currencyrate/currencyrate.py\", line 115, in currencyrates\n    return get_rates(plugin, currency.upper())\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/cachetools/__init__.py\", line 737, in wrapper\n    v = func(*args, **kwargs)\n        ^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.lightning/plugins/currencyrate/currencyrate.py\", line 104, in get_rates\n    r = get_currencyrate(plugin, currency, s.urlformat, s.replymembers)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.lightning/plugins/currencyrate/currencyrate.py\", line 65, in get_currencyrate\n    r = requests_retry_session(retries=5, status_forcelist=[404]).get(url, proxies=plugin.proxies)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/requests/sessions.py\", line 602, in get\n    return self.request(\"GET\", url, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/requests/sessions.py\", line 589, in request\n    resp = self.send(prep, **send_kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/requests/sessions.py\", line 703, in send\n    r = adapter.send(request, **kwargs)\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/urza/.cache/pypoetry/virtualenvs/plugins-4zV4T9r8-py3.12/lib/python3.12/site-packages/requests/adapters.py\", line 588, in send\n    raise RetryError(e, request=request)\nrequests.exceptions.RetryError: HTTPSConnectionPool(host='www.bitstamp.net', port=443): Max retries exceeded with url: /api/v2/ticker/btcczk/ (Caused by ResponseError('too many 404 error responses'))\n"
}
@urza
Copy link
Author

urza commented Jun 17, 2024

I solved the issue by removing bitstamp from currency sources.

@chrisguida
Copy link
Collaborator

Thanks for reporting!

@chrisguida
Copy link
Collaborator

Fixed by #574

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