Upgraded to Bookworm, now 403 Forbidden

As is my habit, I let the intrusive thoughts take over and went ahead with upgrading when my setup (DietPi on an rPi4) suggested to upgrade from Bullseye to Bookworm. Now all I get is 403 Forbidden on the web site.

While I am prepared to reinstall from scratch, might there be someone who has gone down this path and managed to restore functionality?

You can restore the backup that was made prior to the upgrade:

Oh, I misunderstood what you upgraded. Yeah, it’s not advised to upgrade major OS versions like that.

You can try deleting /opt/Mycodo/env, then run sudo /opt/Mycodo/mycodo/scripts/upgrade_post.sh, then restart.

That did most the trick, thank you. Some dependencies were missing. paho-mqtt is back up but inputs that use it aren’t saving data. The Web log is filling up with:

Aug 19 20:46:09 grow python[4671]: influxdb_client.rest.ApiException: (401)
Aug 19 20:46:09 grow python[4671]: Reason: Unauthorized
Aug 19 20:46:09 grow python[4671]: HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.8', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Wed, 20 Aug 2025 03:46:09 GMT', 'Content-Length': '55'})
Aug 19 20:46:09 grow python[4671]: HTTP response body: b'{"code":"unauthorized","message":"unauthorized access"}'
Aug 19 20:46:10 grow python[4671]: 2025-08-19 20:46:10,620 URL for 'last_data' raised and error: (401)
Aug 19 20:46:10 grow python[4671]: Reason: Unauthorized
Aug 19 20:46:10 grow python[4671]: HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.8', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Wed, 20 Aug 2025 03:46:10 GMT', 'Content-Length': '55'})
Aug 19 20:46:10 grow python[4671]: HTTP response body: b'{"code":"unauthorized","message":"unauthorized access"}'
Aug 19 20:46:10 grow python[4671]: Traceback (most recent call last):
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/routes_general.py", line 337, in last_data
Aug 19 20:46:10 grow python[4671]:     data = query_string(
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/utils/influx.py", line 301, in query_string
Aug 19 20:46:10 grow python[4671]:     ret_value = query_flux(
Aug 19 20:46:10 grow python[4671]:                 ^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/utils/influx.py", line 286, in query_flux
Aug 19 20:46:10 grow python[4671]:     tables = client.query_api().query(query)
Aug 19 20:46:10 grow python[4671]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/client/query_api.py", line 203, in query
Aug 19 20:46:10 grow python[4671]:     response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params),
Aug 19 20:46:10 grow python[4671]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py", line 285, in post_query
Aug 19 20:46:10 grow python[4671]:     (data) = self.post_query_with_http_info(**kwargs)  # noqa: E501
Aug 19 20:46:10 grow python[4671]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py", line 311, in post_query_with_http_info
Aug 19 20:46:10 grow python[4671]:     return self.api_client.call_api(
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 343, in call_api
Aug 19 20:46:10 grow python[4671]:     return self.__call_api(resource_path, method,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 173, in __call_api
Aug 19 20:46:10 grow python[4671]:     response_data = self.request(
Aug 19 20:46:10 grow python[4671]:                     ^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 388, in request
Aug 19 20:46:10 grow python[4671]:     return self.rest_client.POST(url,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py", line 311, in POST
Aug 19 20:46:10 grow python[4671]:     return self.request("POST", url,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py", line 261, in request
Aug 19 20:46:10 grow python[4671]:     raise ApiException(http_resp=r)
Aug 19 20:46:10 grow python[4671]: influxdb_client.rest.ApiException: (401)
Aug 19 20:46:10 grow python[4671]: Reason: Unauthorized
Aug 19 20:46:10 grow python[4671]: HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.8', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Wed, 20 Aug 2025 03:46:10 GMT', 'Content-Length': '55'})
Aug 19 20:46:10 grow python[4671]: HTTP response body: b'{"code":"unauthorized","message":"unauthorized access"}'
Aug 19 20:46:10 grow python[4671]: 2025-08-19 20:46:10,649 URL for 'last_data' raised and error: (401)
Aug 19 20:46:10 grow python[4671]: Reason: Unauthorized
Aug 19 20:46:10 grow python[4671]: HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.8', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Wed, 20 Aug 2025 03:46:10 GMT', 'Content-Length': '55'})
Aug 19 20:46:10 grow python[4671]: HTTP response body: b'{"code":"unauthorized","message":"unauthorized access"}'
Aug 19 20:46:10 grow python[4671]: Traceback (most recent call last):
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/routes_general.py", line 337, in last_data
Aug 19 20:46:10 grow python[4671]:     data = query_string(
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/utils/influx.py", line 301, in query_string
Aug 19 20:46:10 grow python[4671]:     ret_value = query_flux(
Aug 19 20:46:10 grow python[4671]:                 ^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo.bullseye/mycodo/utils/influx.py", line 286, in query_flux
Aug 19 20:46:10 grow python[4671]:     tables = client.query_api().query(query)
Aug 19 20:46:10 grow python[4671]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/client/query_api.py", line 203, in query
Aug 19 20:46:10 grow python[4671]:     response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params),
Aug 19 20:46:10 grow python[4671]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py", line 285, in post_query
Aug 19 20:46:10 grow python[4671]:     (data) = self.post_query_with_http_info(**kwargs)  # noqa: E501
Aug 19 20:46:10 grow python[4671]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py", line 311, in post_query_with_http_info
Aug 19 20:46:10 grow python[4671]:     return self.api_client.call_api(
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 343, in call_api
Aug 19 20:46:10 grow python[4671]:     return self.__call_api(resource_path, method,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 173, in __call_api
Aug 19 20:46:10 grow python[4671]:     response_data = self.request(
Aug 19 20:46:10 grow python[4671]:                     ^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py", line 388, in request
Aug 19 20:46:10 grow python[4671]:     return self.rest_client.POST(url,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py", line 311, in POST
Aug 19 20:46:10 grow python[4671]:     return self.request("POST", url,
Aug 19 20:46:10 grow python[4671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 19 20:46:10 grow python[4671]:   File "/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py", line 261, in request
Aug 19 20:46:10 grow python[4671]:     raise ApiException(http_resp=r)
Aug 19 20:46:10 grow python[4671]: influxdb_client.rest.ApiException: (401)
Aug 19 20:46:10 grow python[4671]: Reason: Unauthorized
Aug 19 20:46:10 grow python[4671]: HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.8', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Wed, 20 Aug 2025 03:46:10 GMT', 'Content-Length': '55'})
Aug 19 20:46:10 grow python[4671]: HTTP response body: b'{"code":"unauthorized","message":"unauthorized access"}'

Actually, it looks like the data is getting saved, just not accessed from a dashboard:
2025-08-19 20:49:50,239 - DEBUG - mycodo.inputs.mqtt_paho_87b51f75 - Received message: topic: canopy/temperature1, payload: 26.837
2025-08-19 20:49:50,241 - DEBUG - mycodo.inputs.mqtt_paho_87b51f75 - Found channel 0 with topic ‘canopy/temperature1’
2025-08-19 20:49:50,241 - DEBUG - mycodo.inputs.mqtt_paho_87b51f75 - Payload represents a float: 26.837
2025-08-19 20:49:50,286 - DEBUG - mycodo.inputs.mqtt_paho_87b51f75 - Adding measurement to influxdb: {0: {‘measurement’: ‘temperature’, ‘unit’: ‘C’, ‘value’: 26.837, ‘timestamp_utc’: datetime.datetime(2025, 8, 20, 3, 49, 50, 241150)}}

That is merely stating what it is attempting to save to the database, not that it was successful. To see those types of log messages, you need to turn the Daemon Debug Logging on from the configuration and restart the daemon.

Gotcha. Enabled daemon debug and restarted it. Then activated an MQTT input:

025-08-20 18:14:55,972 - DEBUG - mycodo - Input controller with ID 87b51f75-cb66-461a-9fb8-7e0802e976f1 activated.
2025-08-20 18:14:55,974 - INFO - mycodo.controllers.controller_input_87b51f75 - Activated in 217.6 ms
2025-08-20 18:14:55,977 - INFO - mycodo.inputs.mqtt_paho_87b51f75 - Connected to localhost as client_MceRZmlb
2025-08-20 18:14:58,357 - DEBUG - mycodo.influx - Write point fail: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘Content-Type’: ‘application/json; charset=utf-8’, ‘X-Influxdb-Build’: ‘OSS’, ‘X-Influxdb-Version’: ‘v2.7.8’, ‘X-Platform-Error-Code’: ‘unauthorized’, ‘Date’: ‘Thu, 21 Aug 2025 01:14:58 GMT’, ‘Content-Length’: ‘55’})
HTTP response body: {“code”:“unauthorized”,“message”:“unauthorized access”}
: b’C,channel=0,device_id=87b51f75-cb66-461a-9fb8-7e0802e976f1,measure=temperature value=26.709 1755738897700280000’
2025-08-20 18:15:00,288 - DEBUG - mycodo.influx - Write point fail: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘Content-Type’: ‘application/json; charset=utf-8’, ‘X-Influxdb-Build’: ‘OSS’, ‘X-Influxdb-Version’: ‘v2.7.8’, ‘X-Platform-Error-Code’: ‘unauthorized’, ‘Date’: ‘Thu, 21 Aug 2025 01:15:00 GMT’, ‘Content-Length’: ‘55’})
HTTP response body: {“code”:“unauthorized”,“message”:“unauthorized access”}
: b’C,channel=0,device_id=87b51f75-cb66-461a-9fb8-7e0802e976f1,measure=temperature value=26.666 1755738900217965000’
2025-08-20 18:15:02,254 - INFO - mycodo.controllers.controller_input_87b51f75 - Deactivated in 480.0 ms
2025-08-20 18:15:02,255 - DEBUG - mycodo - Input controller with ID 87b51f75-cb66-461a-9fb8-7e0802e976f1 deactivated.

So it looks like the update to bookworm installed influxdb 2.7.8, whereas it was previously v1. I saw the setting for influxdb version in Mycodo and changed it to V2 but that didn’t fix it.

Syslog is filling up with these:

2025-08-20T21:04:29.571813-07:00 grow influxd-systemd-start.sh[790]: ts=2025-08-21T04:04:29.571591Z lvl=error msg=“api error encountered” log_id=0yTQCms0000 handler=session error=“unauthorized access”
2025-08-20T21:04:29.576205-07:00 grow python[120043]: 2025-08-20 21:04:29,573 URL for ‘last_data’ raised and error: (401)
2025-08-20T21:04:29.576386-07:00 grow python[120043]: Reason: Unauthorized
2025-08-20T21:04:29.576475-07:00 grow python[120043]: HTTP response headers: HTTPHeaderDict({‘Content-Type’: ‘application/json; charset=utf-8’, ‘X-Influxdb-Build’: ‘OSS’, ‘X-Influxdb-Version’: ‘v2.7.8’, ‘X-Platform-Error-Code’: ‘unauthorized’, ‘Date’: ‘Thu, 21 Aug 2025 04:04:29 GMT’, ‘Content-Length’: ‘62’})
2025-08-20T21:04:29.576545-07:00 grow python[120043]: HTTP response body: {
2025-08-20T21:04:29.576610-07:00 grow python[120043]: #011"code": “unauthorized”,
2025-08-20T21:04:29.576674-07:00 grow python[120043]: #011"message": “unauthorized access”
2025-08-20T21:04:29.576737-07:00 grow python[120043]: }
2025-08-20T21:04:29.576806-07:00 grow python[120043]: Traceback (most recent call last):
2025-08-20T21:04:29.576872-07:00 grow python[120043]: File “/opt/Mycodo.bullseye/mycodo/mycodo_flask/routes_general.py”, line 337, in last_data
2025-08-20T21:04:29.576958-07:00 grow python[120043]: data = query_string(
2025-08-20T21:04:29.577023-07:00 grow python[120043]: ^^^^^^^^^^^^^
2025-08-20T21:04:29.577086-07:00 grow python[120043]: File “/opt/Mycodo.bullseye/mycodo/utils/influx.py”, line 301, in query_string
2025-08-20T21:04:29.577148-07:00 grow python[120043]: ret_value = query_flux(
2025-08-20T21:04:29.577222-07:00 grow python[120043]: ^^^^^^^^^^^
2025-08-20T21:04:29.577285-07:00 grow python[120043]: File “/opt/Mycodo.bullseye/mycodo/utils/influx.py”, line 286, in query_flux
2025-08-20T21:04:29.577349-07:00 grow python[120043]: tables = client.query_api().query(query)
2025-08-20T21:04:29.577411-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.577479-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/client/query_api.py”, line 203, in query
2025-08-20T21:04:29.577545-07:00 grow python[120043]: response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect, params),
2025-08-20T21:04:29.577610-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.577675-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py”, line 285, in post_query
2025-08-20T21:04:29.577772-07:00 grow python[120043]: (data) = self.post_query_with_http_info(**kwargs) # noqa: E501
2025-08-20T21:04:29.577841-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.577901-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/query_service.py”, line 311, in post_query_with_http_info
2025-08-20T21:04:29.577967-07:00 grow python[120043]: return self.api_client.call_api(
2025-08-20T21:04:29.578029-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.578096-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 343, in call_api
2025-08-20T21:04:29.578157-07:00 grow python[120043]: return self.__call_api(resource_path, method,
2025-08-20T21:04:29.578221-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.578285-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 121, in __call_api
2025-08-20T21:04:29.578402-07:00 grow python[120043]: self._signin(resource_path=resource_path)
2025-08-20T21:04:29.578481-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 657, in _signin
2025-08-20T21:04:29.578544-07:00 grow python[120043]: http_info = SigninService(self).post_signin_with_http_info()
2025-08-20T21:04:29.578604-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.578670-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/service/signin_service.py”, line 74, in post_signin_with_http_info
2025-08-20T21:04:29.578754-07:00 grow python[120043]: return self.api_client.call_api(
2025-08-20T21:04:29.578825-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.578888-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 343, in call_api
2025-08-20T21:04:29.578948-07:00 grow python[120043]: return self.__call_api(resource_path, method,
2025-08-20T21:04:29.579024-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.579090-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 173, in __call_api
2025-08-20T21:04:29.579151-07:00 grow python[120043]: response_data = self.request(
2025-08-20T21:04:29.579214-07:00 grow python[120043]: ^^^^^^^^^^^^^
2025-08-20T21:04:29.579277-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/api_client.py”, line 388, in request
2025-08-20T21:04:29.579340-07:00 grow python[120043]: return self.rest_client.POST(url,
2025-08-20T21:04:29.579399-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.579467-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py”, line 311, in POST
2025-08-20T21:04:29.579530-07:00 grow python[120043]: return self.request(“POST”, url,
2025-08-20T21:04:29.579591-07:00 grow python[120043]: ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-08-20T21:04:29.579648-07:00 grow python[120043]: File “/opt/Mycodo/env/lib/python3.11/site-packages/influxdb_client/_sync/rest.py”, line 261, in request
2025-08-20T21:04:29.579712-07:00 grow python[120043]: raise ApiException(http_resp=r)
2025-08-20T21:04:29.579778-07:00 grow python[120043]: influxdb_client.rest.ApiException: (401)
2025-08-20T21:04:29.579843-07:00 grow python[120043]: Reason: Unauthorized
2025-08-20T21:04:29.579909-07:00 grow python[120043]: HTTP response headers: HTTPHeaderDict({‘Content-Type’: ‘application/json; charset=utf-8’, ‘X-Influxdb-Build’: ‘OSS’, ‘X-Influxdb-Version’: ‘v2.7.8’, ‘X-Platform-Error-Code’: ‘unauthorized’, ‘Date’: ‘Thu, 21 Aug 2025 04:04:29 GMT’, ‘Content-Length’: ‘62’})
2025-08-20T21:04:29.579970-07:00 grow python[120043]: HTTP response body: {
2025-08-20T21:04:29.580035-07:00 grow python[120043]: #011"code": “unauthorized”,
2025-08-20T21:04:29.580096-07:00 grow python[120043]: #011"message": “unauthorized access”
2025-08-20T21:04:29.580157-07:00 grow python[120043]: }

Poking around the install/setup.sh and then following through the influx2 install commands, I ran ‘influx config’ which reveals that the mycodo database is missing. That makes sense since the system went from v1 to v2.
So I ran the command ‘influx setup --org mycodo --bucket mycodo_db --username mycodo --password mmdu77sj3nIoiajjs --force &&’, and now data is being saved. No errors in the syslog, it’s fixed.

Thank you for making Mycodo awesome!

1 Like

I must be a sucker for punishment and went ahead with upgrading to Trixie. 403 Forbidden again but this time the upgrade_post.sh script did not fix things and there were some errors while it ran, I’ll investigate some more and report.

First error, package libatlas-base-dev is missing:

#### Installing prerequisite apt packages and update pip
Package 'apache2' is not installed, so not removed
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
Package libatlas-base-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Error: Package 'libatlas-base-dev' has no installation candidate

However (as far as I can tell) none of the errors that occur further are due to this package missing.
Libatlas seems to have been entirely removed from Trixie: DOC: Debian trixie package `libatlas-base-dev` removed ¡ Issue #29108 ¡ numpy/numpy ¡ GitHub

Second error, something’s fishy with SQLAlchemy:

#### Upgrading Mycodo database with alembic (if needed)
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/alembic/__init__.py", line 1, in <module>
    from . import context
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/alembic/context.py", line 1, in <module>
    from .runtime.environment import EnvironmentContext
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/alembic/runtime/environment.py", line 19, in <module>
    from sqlalchemy.sql.schema import Column
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/__init__.py", line 13, in <module>
    from .engine import AdaptedConnection as AdaptedConnection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/__init__.py", line 18, in <module>
    from . import events as events
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/events.py", line 19, in <module>
    from .base import Connection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 30, in <module>
    from .interfaces import BindTyping
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/interfaces.py", line 38, in <module>
    from ..sql.compiler import Compiled as Compiled
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/__init__.py", line 14, in <module>
    from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/compiler.py", line 61, in <module>
    from . import crud
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/crud.py", line 34, in <module>
    from . import dml
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/dml.py", line 34, in <module>
    from . import util as sql_util
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/util.py", line 46, in <module>
    from .ddl import sort_tables as sort_tables  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py", line 30, in <module>
    from .elements import ClauseElement
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 810, in <module>
    class SQLCoreOperations(Generic[_T_co], ColumnOperators, TypingOnly):
    ...<472 lines>...
                ...
  File "/usr/lib/python3.13/typing.py", line 1257, in _generic_init_subclass
    super(Generic, cls).__init_subclass__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py", line 1988, in __init_subclass__
    raise AssertionError(
    ...<2 lines>...
    )
AssertionError: Class <class 'sqlalchemy.sql.elements.SQLCoreOperations'> directly inherits TypingOnly but has additional attributes {'__firstlineno__', '__static_attributes__'}.

#### Executing post-alembic script
Traceback (most recent call last):
  File "/opt/Mycodo.bullseye/alembic_db/alembic_post.py", line 32, in <module>
    from mycodo.databases.utils import session_scope
  File "/opt/Mycodo.bullseye/mycodo/databases/__init__.py", line 7, in <module>
    from mycodo.mycodo_flask.extensions import db
  File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/extensions.py", line 12, in <module>
    from flask_sqlalchemy import SQLAlchemy
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/flask_sqlalchemy/__init__.py", line 5, in <module>
    from .extension import SQLAlchemy
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 9, in <module>
    import sqlalchemy as sa
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/__init__.py", line 13, in <module>
    from .engine import AdaptedConnection as AdaptedConnection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/__init__.py", line 18, in <module>
    from . import events as events
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/events.py", line 19, in <module>
    from .base import Connection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 30, in <module>
    from .interfaces import BindTyping
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/interfaces.py", line 38, in <module>
    from ..sql.compiler import Compiled as Compiled
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/__init__.py", line 14, in <module>
    from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/compiler.py", line 61, in <module>
    from . import crud
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/crud.py", line 34, in <module>
    from . import dml
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/dml.py", line 34, in <module>
    from . import util as sql_util
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/util.py", line 46, in <module>
    from .ddl import sort_tables as sort_tables  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py", line 30, in <module>
    from .elements import ClauseElement
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 810, in <module>
    class SQLCoreOperations(Generic[_T_co], ColumnOperators, TypingOnly):
    ...<472 lines>...
                ...
  File "/usr/lib/python3.13/typing.py", line 1257, in _generic_init_subclass
    super(Generic, cls).__init_subclass__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py", line 1988, in __init_subclass__
    raise AssertionError(
    ...<2 lines>...
    )
AssertionError: Class <class 'sqlalchemy.sql.elements.SQLCoreOperations'> directly inherits TypingOnly but has additional attributes {'__static_attributes__', '__firstlineno__'}.

Third error is similar to the second one, SQLAlchemy:

#### Checking for updates to dependencies
Traceback (most recent call last):
  File "/opt/Mycodo.bullseye/mycodo/utils/update_dependencies.py", line 13, in <module>
    from mycodo.databases.models import (Actions, Camera, Conditional,
                                         CustomController, EnergyUsage, Function,
                                         Input, Method, Output, Trigger, Widget)
  File "/opt/Mycodo.bullseye/mycodo/databases/__init__.py", line 7, in <module>
    from mycodo.mycodo_flask.extensions import db
  File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/extensions.py", line 12, in <module>
    from flask_sqlalchemy import SQLAlchemy
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/flask_sqlalchemy/__init__.py", line 5, in <module>
    from .extension import SQLAlchemy
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 9, in <module>
    import sqlalchemy as sa
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/__init__.py", line 13, in <module>
    from .engine import AdaptedConnection as AdaptedConnection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/__init__.py", line 18, in <module>
    from . import events as events
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/events.py", line 19, in <module>
    from .base import Connection
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 30, in <module>
    from .interfaces import BindTyping
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/engine/interfaces.py", line 38, in <module>
    from ..sql.compiler import Compiled as Compiled
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/__init__.py", line 14, in <module>
    from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/compiler.py", line 61, in <module>
    from . import crud
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/crud.py", line 34, in <module>
    from . import dml
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/dml.py", line 34, in <module>
    from . import util as sql_util
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/util.py", line 46, in <module>
    from .ddl import sort_tables as sort_tables  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py", line 30, in <module>
    from .elements import ClauseElement
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 810, in <module>
    class SQLCoreOperations(Generic[_T_co], ColumnOperators, TypingOnly):
    ...<472 lines>...
                ...
  File "/usr/lib/python3.13/typing.py", line 1257, in _generic_init_subclass
    super(Generic, cls).__init_subclass__(*args, **kwargs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/Mycodo.bullseye/env/lib/python3.13/site-packages/sqlalchemy/util/langhelpers.py", line 1988, in __init_subclass__
    raise AssertionError(
    ...<2 lines>...
    )
AssertionError: Class <class 'sqlalchemy.sql.elements.SQLCoreOperations'> directly inherits TypingOnly but has additional attributes {'__firstlineno__', '__static_attributes__'}.

#### Updating mycodo startup script

The mycodoflask.service wont start, SQLAlchemy in the logs again:

root@grow:/var/log# systemctl -n100 status mycodoflask 
× mycodoflask.service - Mycodo web user interface
     Loaded: loaded (/etc/systemd/system/mycodoflask.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2025-09-28 18:20:29 PDT; 4min 47s ago
   Duration: 1.412s
 Invocation: 33b20c1b23c14e49834f145d8015c95d
    Process: 12222 ExecStart=/opt/Mycodo/env/bin/python -m gunicorn --workers 1 --worker-class gthread --threads 2 --timeout 300 --pid /var/run/mycodoflask.pid --bind unix:/usr/local/mycodoflask.sock start_flask_ui:app (code=exited, status=3)
   Main PID: 12222 (code=exited, status=3)
        CPU: 1.391s

Sep 28 18:20:28 grow systemd[1]: Started mycodoflask.service - Mycodo web user interface.
Sep 28 18:20:28 grow python[12222]: [2025-09-28 18:20:28 -0700] [12222] [INFO] Starting gunicorn 21.2.0
Sep 28 18:20:28 grow python[12222]: [2025-09-28 18:20:28 -0700] [12222] [INFO] Listening at: unix:/usr/local/mycodoflask.sock (12222)
Sep 28 18:20:28 grow python[12222]: [2025-09-28 18:20:28 -0700] [12222] [INFO] Using worker: gthread
Sep 28 18:20:28 grow python[12223]: [2025-09-28 18:20:28 -0700] [12223] [INFO] Booting worker with pid: 12223
Sep 28 18:20:29 grow python[12223]: [2025-09-28 18:20:29 -0700] [12223] [ERROR] Exception in worker process
Sep 28 18:20:29 grow python[12223]: Traceback (most recent call last):
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Sep 28 18:20:29 grow python[12223]:     worker.init_process()
Sep 28 18:20:29 grow python[12223]:     ~~~~~~~~~~~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Sep 28 18:20:29 grow python[12223]:     super().init_process()
Sep 28 18:20:29 grow python[12223]:     ~~~~~~~~~~~~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/workers/base.py", line 134, in init_process
Sep 28 18:20:29 grow python[12223]:     self.load_wsgi()
Sep 28 18:20:29 grow python[12223]:     ~~~~~~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Sep 28 18:20:29 grow python[12223]:     self.wsgi = self.app.wsgi()
Sep 28 18:20:29 grow python[12223]:                 ~~~~~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/app/base.py", line 67, in wsgi
Sep 28 18:20:29 grow python[12223]:     self.callable = self.load()
Sep 28 18:20:29 grow python[12223]:                     ~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Sep 28 18:20:29 grow python[12223]:     return self.load_wsgiapp()
Sep 28 18:20:29 grow python[12223]:            ~~~~~~~~~~~~~~~~~^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Sep 28 18:20:29 grow python[12223]:     return util.import_app(self.app_uri)
Sep 28 18:20:29 grow python[12223]:            ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/gunicorn/util.py", line 371, in import_app
Sep 28 18:20:29 grow python[12223]:     mod = importlib.import_module(module)
Sep 28 18:20:29 grow python[12223]:   File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
Sep 28 18:20:29 grow python[12223]:     return _bootstrap._gcd_import(name[level:], package, level)
Sep 28 18:20:29 grow python[12223]:            ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
Sep 28 18:20:29 grow python[12223]:   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo.bullseye/mycodo/start_flask_ui.py", line 11, in <module>
Sep 28 18:20:29 grow python[12223]:     from mycodo.mycodo_flask.app import create_app
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/app.py", line 19, in <module>
Sep 28 18:20:29 grow python[12223]:     from mycodo.databases.models import Misc, User, Widget, populate_db
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo.bullseye/mycodo/databases/__init__.py", line 7, in <module>
Sep 28 18:20:29 grow python[12223]:     from mycodo.mycodo_flask.extensions import db
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo.bullseye/mycodo/mycodo_flask/extensions.py", line 12, in <module>
Sep 28 18:20:29 grow python[12223]:     from flask_sqlalchemy import SQLAlchemy
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/flask_sqlalchemy/__init__.py", line 5, in <module>
Sep 28 18:20:29 grow python[12223]:     from .extension import SQLAlchemy
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/flask_sqlalchemy/extension.py", line 9, in <module>
Sep 28 18:20:29 grow python[12223]:     import sqlalchemy as sa
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/__init__.py", line 13, in <module>
Sep 28 18:20:29 grow python[12223]:     from .engine import AdaptedConnection as AdaptedConnection
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/engine/__init__.py", line 18, in <module>
Sep 28 18:20:29 grow python[12223]:     from . import events as events
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/engine/events.py", line 19, in <module>
Sep 28 18:20:29 grow python[12223]:     from .base import Connection
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 30, in <module>
Sep 28 18:20:29 grow python[12223]:     from .interfaces import BindTyping
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/engine/interfaces.py", line 38, in <module>
Sep 28 18:20:29 grow python[12223]:     from ..sql.compiler import Compiled as Compiled
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/__init__.py", line 14, in <module>
Sep 28 18:20:29 grow python[12223]:     from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/compiler.py", line 61, in <module>
Sep 28 18:20:29 grow python[12223]:     from . import crud
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/crud.py", line 34, in <module>
Sep 28 18:20:29 grow python[12223]:     from . import dml
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/dml.py", line 34, in <module>
Sep 28 18:20:29 grow python[12223]:     from . import util as sql_util
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/util.py", line 46, in <module>
Sep 28 18:20:29 grow python[12223]:     from .ddl import sort_tables as sort_tables  # noqa: F401
Sep 28 18:20:29 grow python[12223]:     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/ddl.py", line 30, in <module>
Sep 28 18:20:29 grow python[12223]:     from .elements import ClauseElement
Sep 28 18:20:29 grow python[12223]:   File "/opt/Mycodo/env/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 810, in <module>
Sep 28 18:20:29 grow python[12223]:     class SQLCoreOperations(Generic[_T_co], ColumnOperators, TypingOnly):
root@grow:/var/log# 

Regarding SQLAlchemy:

mycodo@grow:/var/log$ pip show sqlalchemy
Name: SQLAlchemy
Version: 2.0.43
Summary: Database Abstraction Library
Home-page: https://www.sqlalchemy.org
Author: Mike Bayer
Author-email: mike_mp@zzzcomputing.com
License: MIT
Location: /home/mycodo/.local/lib/python3.13/site-packages
Requires: greenlet, typing-extensions
Required-by: 
mycodo@grow:/var/log$ 

Mycodo has it’s own virtualenv, which it doesn’t appear you have activated or are executing pip from.

You’re also not showing the entire traceback of the mycodo_flask service failure, however it looks like might be the same error as the previous pasted texts.

I just figured that. The SQLAlchemy in the venv is 2.0.25, … hold on

Bumping up systemctl status to -n10000 only returns the same output, no further trace.

OK, fixed. Manually upgrading SQLAlchemy to 2.0.43 and we’re back up.

Thank you for making Mycodo awesome!

1 Like

It’s only been tested to work with Bookworm. Anything newer you’re on your own, until I can get time to test the install and functionality on the new release. But if you do make any progress please share. I’m not sure when I’ll be able to test.

To summarize, if you decide to shoot yourself in the foot like this, the fix is:
-delete /opt/Mycodo/env
-run /opt/Mycodo/mycodo/scripts/upgrade_post.sh
-if you did Bullseye to Bookworm (influx1 to influx2), run influx setup --org mycodo --bucket mycodo_db --username mycodo --password mmdu77sj3nIoiajjs --force
-source /opt/Mycodo/mycodo/env/bin/activate

  • pip install --upgrade sqlalchemy

-reinstall missing input/output/function dependencies within Mycodo

Your mileage may vary.

1 Like