Live Measurements error

Hi,

While doing maintenance cleanup shut down the Mycodo system and restarted. Everything is fine except for Live Measurements which gives this error:

Error 500: Internal Server Error
Something bad happened but it’s probably not your fault. Letting the developers know about these issues is crucial to supporting Mycodo. Please submit a new issue on GitHub with the following diagnostic information and error traceback (copy the entire traceback):

Version: 8.14.2
Database: 07c7c8ebc195
Model: Raspberry Pi 4 Model B Rev 1.1

Release:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Firmware:
b’’

Error (Full Traceback):

Traceback (most recent call last):
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 2077, in wsgi_app
response = self.full_dispatch_request()
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_restx/api.py”, line 672, in error_router
return original_handler(e)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1523, in full_dispatch_request
rv = self.dispatch_request()
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_login/utils.py”, line 277, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File “/home/craig/Mycodo/mycodo/mycodo_flask/routes_page.py”, line 852, in page_live
return render_template(‘pages/live.html’,
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 148, in render_template
return _render(
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 128, in _render
rv = template.render(context)
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 1301, in render
self.environment.handle_exception()
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 3, in top-level template code
{% set help_page = [“Data Viewing - Mycodo”, _(‘Live Measurements’)] %}
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/layout.html”, line 383, in top-level template code
{%- block body %}{% endblock -%}
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 167, in block ‘body’
{%- if dict_units[dict_measure_units[each_meas.unique_id]][‘unit’] -%}
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 466, in getitem
return obj[argument]
jinja2.exceptions.UndefinedError: ‘collections.OrderedDict object’ has no attribute ‘’

Thanks
Craig

I’ve been away all weekend, but I’ll take a look at this issue this week.

I just committed a potential fix

Upgrade to master if you would like to test the fix.

Hi Kyle,

Still there. Tried the upgrade twice just in case it failed for some reason, but I see it is slightly different previous line error was 167 now 174.

Error 500: Internal Server Error
Something bad happened but it’s probably not your fault. Letting the developers know about these issues is crucial to supporting Mycodo. Please submit a new issue on GitHub with the following diagnostic information and error traceback (copy the entire traceback):

Version: 8.14.2
Database: 07c7c8ebc195
Model: Raspberry Pi 4 Model B Rev 1.1

Release:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Firmware:
b’’

Error (Full Traceback):

Traceback (most recent call last):
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 2077, in wsgi_app
response = self.full_dispatch_request()
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_restx/api.py”, line 672, in error_router
return original_handler(e)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1523, in full_dispatch_request
rv = self.dispatch_request()
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_login/utils.py”, line 277, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File “/home/craig/Mycodo/mycodo/mycodo_flask/routes_page.py”, line 852, in page_live
return render_template(‘pages/live.html’,
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 148, in render_template
return _render(
File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 128, in _render
rv = template.render(context)
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 1301, in render
self.environment.handle_exception()
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 3, in top-level template code
{% set help_page = [“Data Viewing - Mycodo”, _(‘Live Measurements’)] %}
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/layout.html”, line 383, in top-level template code
{%- block body %}{% endblock -%}
File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 174, in block ‘body’
{%- elif dict_units[dict_measure_units[each_meas.unique_id]][‘name’] -%}
File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 466, in getitem
return obj[argument]
jinja2.exceptions.UndefinedError: ‘collections.OrderedDict object’ has no attribute ‘’

Thanks

It did upgrade successfully:

Sep 20 15:54:45 mygreenhouse python[11571]: [2022-09-20 15:54:45] #### Completed Upgrade Stage 3 of 3 in 121 seconds ####
Sep 20 15:54:45 mygreenhouse python[11571]: [2022-09-20 15:54:45]
Sep 20 15:54:45 mygreenhouse python[11571]: [2022-09-20 15:54:45] Upgrade completed. Review the log to ensure no critical errors were encountered
Sep 20 16:06:25 mygreenhouse python[12514]: 2022-09-20 16:06:25,201 User may not be logged in. Clearing cookie auth.
Sep 20 18:51:21 mygreenhouse python[12514]: 2022-09-20 18:51:21,494 Exception on /live [GET]
Sep 20 18:51:21 mygreenhouse python[12514]: Traceback (most recent call last):
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 2077, in wsgi_app
Sep 20 18:51:21 mygreenhouse python[12514]: response = self.full_dispatch_request()
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1525, in full_dispatch_request
Sep 20 18:51:21 mygreenhouse python[12514]: rv = self.handle_user_exception(e)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_restx/api.py”, line 672, in error_router
Sep 20 18:51:21 mygreenhouse python[12514]: return original_handler(e)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1523, in full_dispatch_request
Sep 20 18:51:21 mygreenhouse python[12514]: rv = self.dispatch_request()
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py”, line 1509, in dispatch_request
Sep 20 18:51:21 mygreenhouse python[12514]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask_login/utils.py”, line 277, in decorated_view
Sep 20 18:51:21 mygreenhouse python[12514]: return current_app.ensure_sync(func)(*args, **kwargs)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/home/craig/Mycodo/mycodo/mycodo_flask/routes_page.py”, line 852, in page_live
Sep 20 18:51:21 mygreenhouse python[12514]: return render_template(‘pages/live.html’,
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 148, in render_template
Sep 20 18:51:21 mygreenhouse python[12514]: return _render(
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/flask/templating.py”, line 128, in _render
Sep 20 18:51:21 mygreenhouse python[12514]: rv = template.render(context)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 1301, in render
Sep 20 18:51:21 mygreenhouse python[12514]: self.environment.handle_exception()
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 936, in handle_exception
Sep 20 18:51:21 mygreenhouse python[12514]: raise rewrite_traceback_stack(source=source)
Sep 20 18:51:21 mygreenhouse python[12514]: File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 3, in top-level template code
Sep 20 18:51:21 mygreenhouse python[12514]: {% set help_page = [“Data Viewing - Mycodo”, _(‘Live Measurements’)] %}
Sep 20 18:51:21 mygreenhouse python[12514]: File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/layout.html”, line 383, in top-level template code
Sep 20 18:51:21 mygreenhouse python[12514]: {%- block body %}{% endblock -%}
Sep 20 18:51:21 mygreenhouse python[12514]: File “/home/craig/Mycodo/mycodo/mycodo_flask/templates/pages/live.html”, line 174, in block ‘body’
Sep 20 18:51:21 mygreenhouse python[12514]: {%- elif dict_units[dict_measure_units[each_meas.unique_id]][‘name’] -%}
Sep 20 18:51:21 mygreenhouse python[12514]: File “/var/mycodo-root/env/lib/python3.9/site-packages/jinja2/environment.py”, line 466, in getitem
Sep 20 18:51:21 mygreenhouse python[12514]: return obj[argument]
Sep 20 18:51:21 mygreenhouse python[12514]: jinja2.exceptions.UndefinedError: ‘collections.OrderedDict object’ has no attribute ‘’
Sep 20 18:51:21 mygreenhouse python[16608]: /bin/sh: 1: /opt/vc/bin/vcgencmd: not found

Fixed. Try upgrading again.

1 Like

Perfect, thank you. No errors all screens working well.

1 Like