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

GET /status/vehicle/x/ 500 error caused by window_heating_status.py #226

Open
JeromeGillard opened this issue Dec 23, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@JeromeGillard
Copy link

Describe the bug
Can't see vehicle status.

To Reproduce
Steps to reproduce the behavior:

  1. Spin the default docker-compose.yml, with valid .env file.
  2. Go to a car' status

Expected behavior
No 500 error.

Logs

2024-12-23T11:55:57+0000:INFO:_internal:172.23.0.6 - - [23/Dec/2024 11:55:57] "GET /status/vehicle/-redacted-/ HTTP/1.1" 500 -
2024-12-23T11:55:57+0000:ERROR:_internal:Error on request:
Traceback (most recent call last):
  File "/opt/venv/lib/python3.12/site-packages/werkzeug/serving.py", line 370, in run_wsgi
    execute(self.server.app)
  File "/opt/venv/lib/python3.12/site-packages/werkzeug/serving.py", line 331, in execute
    application_iter = app(environ, start_response)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 1498, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 1476, in wsgi_app
    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/vwsfriend/ui/status.py", line 25, in vehicle
    return render_template('status/vehicle.html', vehicle=vehicles[vin], current_app=current_app)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/templating.py", line 150, in render_template
    return _render(app, template, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/flask/templating.py", line 131, in _render
    rv = template.render(context)
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/opt/venv/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/venv/lib/python3.12/site-packages/vwsfriend/ui/templates/status/vehicle.html", line 1, in top-level template code
    {% extends 'base.html' %}
  File "/opt/venv/lib/python3.12/site-packages/vwsfriend/ui/templates/base.html", line 40, in top-level template code
    {% block content %}{% endblock %}
  File "/opt/venv/lib/python3.12/site-packages/vwsfriend/ui/templates/status/vehicle.html", line 247, in block 'content'
    <li> {{window}}</li>
  File "/opt/venv/lib/python3.12/site-packages/weconnect/elements/window_heating_status.py", line 84, in __str__
    return f'{self.id}: {self.windowHeatingState.value.value}'  # pylint: disable=no-member
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'value'

  • OS: Docker image
  • Version used 0.24.7

Additional context
Fresh install.

@JeromeGillard JeromeGillard added the bug Something isn't working label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants