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#