spiral-project / ihatemoney

A simple shared budget manager web application
https://ihatemoney.org
Other
1.18k stars 267 forks source link

I don't know enough and not sure what caused this. #1231

Closed LilPeen closed 1 year ago

LilPeen commented 1 year ago

I've been using this for some time now without issue.. Installed on Linux/Docker:

Things were working great but this week I can't login.. I'm not even sure I can just reinstall and replace the db it created to not lose anything. but looking at logs from Portainer:

[2023-09-26 20:28:55 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-09-26 20:28:55 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2023-09-26 20:28:55 +0000] [1] [INFO] Using worker: sync
[2023-09-26 20:28:55 +0000] [8] [INFO] Booting worker with pid: 8
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
ERROR [ihatemoney.run] Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/src/ihatemoney/web.py", line 276, in home
    project_form = get_project_form()
  File "/src/ihatemoney/web.py", line 271, in get_project_form
    return ProjectForm()
  File "/usr/local/lib/python3.10/site-packages/wtforms/form.py", line 208, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "/src/ihatemoney/forms.py", line 153, in __init__
    for currency_name in self.currency_helper.get_currencies()
  File "/src/ihatemoney/currency_convertor.py", line 31, in get_currencies
    for rate in self.get_rates()
  File "/usr/local/lib/python3.10/site-packages/cachetools/__init__.py", line 520, in wrapper
    v = func(*args, **kwargs)
  File "/src/ihatemoney/currency_convertor.py", line 24, in get_rates
    rates = requests.get(self.api_url).json()["rates"]
KeyError: 'rates'

I found another issue, but it just says resolved back in 2021.. I apologize for my ignorance but hoping someone can assist so I don't need to start over :D and of course I can provide anything else if necessary.

Thanks!

almet commented 1 year ago

Hi, this seems caused by the fact we're relying on an API which doesn't exist anymore. We need to remove this code and find a solution for when currencies are set in a project.

Sorry for this!

almet commented 1 year ago

@LilPeen can you tell us what version of IHM are you using?

almet commented 1 year ago

I believe this exact bug has been fixed by https://github.com/spiral-project/ihatemoney/commit/9341dc292eed75a1deefac3dd1c9689eeccf6e91, so an update should get you a long way :-)

I'll close this, don't hesitate to let me know if it's not working for you.

LilPeen commented 1 year ago

Thank you very much! resolved everything and I lost nothing!! <3