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

Upgrading from 8.8.8 to latest 8.9.1 results in dictionary error #949

Closed
rbbrdckybk opened this issue Mar 14, 2021 · 4 comments
Closed

Upgrading from 8.8.8 to latest 8.9.1 results in dictionary error #949

rbbrdckybk opened this issue Mar 14, 2021 · 4 comments

Comments

@rbbrdckybk
Copy link

Just upgraded a basically fresh install of MyCodo 8.8.8 to 8.9.1 via the web interface. Upgrade completed successfully, no errors. After the upgrade, navigating to most pages results in the following HTTP 500 error (I'm new to MyCodo, but vaguely remember creating a custom measurement that I tagged "999" when I was originally looking things over - so I assume the dictionary error has something to do with that):

Error (Full Traceback):

Traceback (most recent call last):
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_restx/api.py", line 639, in error_router
return original_handler(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_login/utils.py", line 272, in decorated_view
return func(*args, **kwargs)
File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_page.py", line 1200, in page_live
use_unit=use_unit)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/pi/Mycodo/mycodo/mycodo_flask/templates/pages/live.html", line 3, in top-level template code
{% set help_page = ["https://kizniche.github.io/Mycodo/Data-Viewing/#live-measurements", _('Live Measurements')] %}
File "/home/pi/Mycodo/mycodo/mycodo_flask/templates/layout.html", line 327, in top-level template code
{%- block body %}{% endblock -%}
File "/home/pi/Mycodo/mycodo/mycodo_flask/templates/pages/live.html", line 118, in block "body"
{{' (' + dict_measurements[each_meas.measurement]['name'] + ') '}}
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/jinja2/environment.py", line 452, in getitem
return obj[argument]
jinja2.exceptions.UndefinedError: 'collections.OrderedDict object' has no attribute '999'

@kizniche
Copy link
Owner

It looks like one of your inputs may be referencing a missing measurement.

@rbbrdckybk
Copy link
Author

That is probably it. I set MyCodo up as a fresh 8.8.8 install a couple weeks ago, and set up a single input to test things. I'm pretty sure I created a custom measurement, and I probably set my input to reference it. Everything has been working properly for weeks, until the upgrade to 8.9.1 yesterday. The upgrade completed successfully without errors, but I can't navigate to most pages now - I just get this error. I'm pretty sure something happened during the upgrade that dropped or otherwise broke the custom measurement.

I'll probably just re-install MyCodo since I didn't have much set up anyway - just wanted to give you a heads up!

@kizniche
Copy link
Owner

kizniche commented Mar 15, 2021

I can replicate this issue. I'll figure out a way to prevent all the page issues when a measurement is deleted that other controllers are still referencing.

@kizniche
Copy link
Owner

just made a release that fixes the errors on the Input/Function pages when there are missing measurements/units and will indicate there's an issue when the options are expanded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants