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

http status 500 for activities #85

Closed
Natenom opened this issue Jan 18, 2024 · 1 comment
Closed

http status 500 for activities #85

Natenom opened this issue Jan 18, 2024 · 1 comment

Comments

@Natenom
Copy link

Natenom commented Jan 18, 2024

Current master.

Get this when trying to open any activity:

2024-01-18 20:32:58 geo_activity_playground.webui.app ERROR Exception on /activity/4587788469260011142 [GET]
Traceback (most recent call last):
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/webui/app.py", line 30, in activity
    "activity.html.j2", **activity_controller.render_activity(int(id))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/webui/activity_controller.py", line 40, in render_activity
    "color_line_geojson": make_geojson_color_line(time_series),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/my/src/github/geo-activity-playground/geo_activity_playground/core/activities.py", line 172, in make_geojson_color_line
    return geojson.dumps(
           ^^^^^^^^^^^^^^
  File "/home/me/.cache/pypoetry/virtualenvs/geo-activity-playground-SZxD7HkL-py3.11/lib/python3.11/site-packages/geojson/codec.py", line 31, in dumps
    return json.dumps(to_mapping(obj),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ^^^^^^^^^^^
  File "/usr/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
ValueError: Out of range float values are not JSON compliant
2024-01-18 20:32:58 werkzeug INFO 127.0.0.1 - - [18/Jan/2024 20:32:58] "GET /activity/4587788469260011142 HTTP/1.1" 500 -

@martin-ueding
Copy link
Owner

The problem was that some speed values come out as not-a-number. I am not sure why, but these values are just ignored now and then it works.

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