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

"Internal Server Error" on mobile device #1188

Closed
jonathan8devs opened this issue Jul 14, 2023 · 4 comments · Fixed by #1194
Closed

"Internal Server Error" on mobile device #1188

jonathan8devs opened this issue Jul 14, 2023 · 4 comments · Fixed by #1194
Assignees
Labels

Comments

@jonathan8devs
Copy link

Environment:

Server: Ubuntu 22.04
iHateMoney: via Docker & Traefik
Did you turn it off and on: yes

Mobile device: iPhone14Pro with Safari
Notebook: Macbook Pro 13.4.1 with Firefox

I did the update to version 6.0.0 yesterday. This has also worked so far without problems. When I opened the page in mobile view this morning, I got an "Internal Server Error". I wondered and thought maybe just the container crashed. Before I checked this, I noticed that there is no error in the browser, but only on the mobile device.

This is what is written in the Docker logs for each mobile call:

project_name     | ERROR [ihatemoney.run] Exception on / [GET]
project_name     | Traceback (most recent call last):
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2529, in wsgi_app
project_name     |     response = self.full_dispatch_request()
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
project_name     |     rv = self.handle_user_exception(e)
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 298, in error_router
project_name     |     return original_handler(e)
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
project_name     |     rv = self.dispatch_request()
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
project_name     |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
project_name     |   File "/src/ihatemoney/web.py", line 288, in home
project_name     |     return render_template(
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/templating.py", line 147, in render_template
project_name     |     return _render(app, template, context)
project_name     |   File "/usr/local/lib/python3.10/site-packages/flask/templating.py", line 130, in _render
project_name     |     rv = template.render(context)
project_name     |   File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
project_name     |     self.environment.handle_exception()
project_name     |   File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
project_name     |     raise rewrite_traceback_stack(source=source)
project_name     |   File "/src/ihatemoney/templates/home.html", line 1, in top-level template code
project_name     |     {% extends "layout.html" %}
project_name     |   File "/src/ihatemoney/templates/layout.html", line 111, in top-level template code
project_name     |     {% for id, name in session['projects'].items() %}
project_name     |   File "/usr/local/lib/python3.10/site-packages/jinja2/utils.py", line 83, in from_obj
project_name     |     if hasattr(obj, "jinja_pass_arg"):
project_name     | jinja2.exceptions.UndefinedError: 'list object' has no attribute 'items'
@zorun
Copy link
Collaborator

zorun commented Jul 14, 2023

@Glandos it seems related to #1082 ? I believe we should account for existing session data that may still use a list, and convert it if required.

@zorun zorun added the bug label Jul 14, 2023
@haivala
Copy link

haivala commented Jul 14, 2023

I got same error

@Glandos
Copy link
Member

Glandos commented Jul 15, 2023

I reproduced the issue:

Yes, it's #1082 that introduce a dict, and think that everything is now a dict. Session has to be cleared, but since it's from the homepage, it's a bit difficult to logout…

@haivala and @jonathan8devs you can clear your cookies as a workaround.
But I'm working on a fix to avoid a deluge of issues from migrated users.

@zorun
Copy link
Collaborator

zorun commented Jul 16, 2023

Well done @Glandos , I had tried to reproduce it but couldn't, it's definitely a bit tricky!

zorun pushed a commit that referenced this issue Jul 22, 2023
TomRoussel pushed a commit to TomRoussel/ihatemoney that referenced this issue Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants