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

[BUG] Database srror after upgrade from 1.5.10 to 1.5.11 #1725

Open
2 tasks done
thelittlefireman opened this issue Nov 18, 2024 · 9 comments
Open
2 tasks done

[BUG] Database srror after upgrade from 1.5.10 to 1.5.11 #1725

thelittlefireman opened this issue Nov 18, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@thelittlefireman
Copy link
Contributor

thelittlefireman commented Nov 18, 2024

What happened?

After upgrade from 1.5.10 to 1.5.11 i've got a lot of database errors.

How to reproduce?

upgrade from 1.5.10 to 1.5.11

Configuration file(s) (yaml or .env)

No response

Relevant log output

Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:25 +0000] [GENERATOR] [34] [⚠️ ] - Database version (error) is different from Bunkerweb version (1.5.11), migrating ...
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:25 +0000] [GENERATOR] [34] [⚠️ ] - Table "bw_cli_commands" already exists, dropping it to make room for the new one
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:25 +0000] [GENERATOR] [34] [⚠️ ] - Table "bw_plugins" already exists, dropping it to make room for the new one
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: /usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   session.rollback()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:25 +0000] [GENERATOR] [34] [❌] - Exception while executing config saver : Traceback (most recent call last):
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: pymysql.err.OperationalError: (3730, "Cannot drop table 'bw_plugins_error' referenced by a foreign key constraint 'bw_settings_error_ibfk_1' on table 'bw_settings_error'.")
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: The above exception was the direct cause of the following exception:
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: Traceback (most recent call last):
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/gen/save_config.py", line 302, in <module>
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     ret, err = db.init_tables(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:                ^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/db/Database.py", line 699, in init_tables
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     session.execute(text(f"DROP TABLE {table_name}_{db_version_id}"))
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/scoping.py", line 778, in execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     return self._proxied.execute(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     return self._execute_internal(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2256, in _execute_internal
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     result = conn.execute(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     return meth(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:            ^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     return connection._execute_clauseelement(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     ret = self._execute_context(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:           ^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     return self._exec_single_context(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     self._handle_dbapi_exception(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (3730, "Cannot drop table 'bw_plugins_error' referenced by a foreign key constraint 'bw_settings_error_ibfk_1' on table 'bw_settings_error'.")
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: [SQL: DROP TABLE bw_plugins_error]
Nov 18 23:39:25 172.16.1.1 ba333321ce29[26671]: (Background on this error at: https://sqlalche.me/e/20/e3q8)
Nov 18 23:39:26 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:26 +0000] [SCHEDULER] [21] [❌] - Config saver failed, configuration will not work as expected...

Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:32 +0000] [JOBS.DOWNLOAD-PLUGINS] [92] [❌] - Exception while installing plugin(s) from https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.6.zip :
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: Traceback (most recent call last):
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: The above exception was the direct cause of the following exception:
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: Traceback (most recent call last):
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 159, in <module>
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     if install_plugin(plugin_path.parent, db):
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 64, in install_plugin
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     for plugin in db.get_plugins(_type="external"):
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/db/Database.py", line 2407, in get_plugins
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     for command in session.query(BwcliCommands).with_entities(BwcliCommands.name, BwcliCommands.file_name).filter_by(plugin_id=plugin.id):
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2813, in __iter__
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result = self._iter()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2827, in _iter
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                                                   ^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     return self._execute_internal(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result: Result[Any] = compile_state_cls.orm_execute_statement(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result = conn.execute(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     return meth(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:            ^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     return connection._execute_clauseelement(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     ret = self._execute_context(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:           ^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     return self._exec_single_context(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     self._handle_dbapi_exception(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: [SQL: SELECT bw_cli_commands.name AS bw_cli_commands_name, bw_cli_commands.file_name AS bw_cli_commands_file_name 
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: FROM bw_cli_commands 
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: WHERE bw_cli_commands.plugin_id = %(plugin_id_1)s]
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: [parameters: {'plugin_id_1': 'clamav'}]
Nov 18 23:39:32 172.16.1.1 ba333321ce29[26671]: (Background on this error at: https://sqlalche.me/e/20/f405)

...

[2024-11-18 22:39:47 +0000] [JOBS.DOWNLOAD-PLUGINS] [183] [ℹ️ ] - Downloading external plugins from https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.6.zip...
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: /usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   session.rollback()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:39:48 +0000] [JOBS.DOWNLOAD-PLUGINS] [183] [❌] - Exception while installing plugin(s) from https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.6.zip :
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: Traceback (most recent call last):
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: The above exception was the direct cause of the following exception:
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: Traceback (most recent call last):
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 159, in <module>
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     if install_plugin(plugin_path.parent, db):
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 64, in install_plugin
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     for plugin in db.get_plugins(_type="external"):
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/db/Database.py", line 2407, in get_plugins
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     for command in session.query(BwcliCommands).with_entities(BwcliCommands.name, BwcliCommands.file_name).filter_by(plugin_id=plugin.id):
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2813, in __iter__
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result = self._iter()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2827, in _iter
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                                                   ^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     return self._execute_internal(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result: Result[Any] = compile_state_cls.orm_execute_statement(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result = conn.execute(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     return meth(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:            ^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     return connection._execute_clauseelement(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     ret = self._execute_context(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:           ^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     return self._exec_single_context(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     self._handle_dbapi_exception(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     self.dialect.do_execute(
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     cursor.execute(statement, parameters)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result = self._query(query)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:              ^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     conn.query(q)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     result.read()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     first_packet = self.connection._read_packet()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     packet.raise_for_error()
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     err.raise_mysql_exception(self._data)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:   File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]:     raise errorclass(errno, errval)
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: [SQL: SELECT bw_cli_commands.name AS bw_cli_commands_name, bw_cli_commands.file_name AS bw_cli_commands_file_name 
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: FROM bw_cli_commands 
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: WHERE bw_cli_commands.plugin_id = %(plugin_id_1)s]
Nov 18 23:39:48 172.16.1.1 ba333321ce29[26671]: [parameters: {'plugin_id_1': 'clamav'}]

...
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: [2024-11-18 22:40:11 +0000] [SCHEDULER] [21] [❌] - An error occurred when setting the changes to checked in the database : (pymysql.err.OperationalError) (1054, "Unknown column 'bw_metadata.non_draft_services' in 'field list'")
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: [SQL: SELECT bw_metadata.id AS bw_metadata_id, bw_metadata.is_initialized AS bw_metadata_is_initialized, bw_metadata.is_pro AS bw_metadata_is_pro, bw_metadata.pro_license AS bw_metadata_pro_license, bw_metadata.pro_expire AS bw_metadata_pro_expire, bw_metadata.pro_status AS bw_metadata_pro_status, bw_metadata.pro_services AS bw_metadata_pro_services, bw_metadata.non_draft_services AS bw_metadata_non_draft_services, bw_metadata.pro_overlapped AS bw_metadata_pro_overlapped, bw_metadata.last_pro_check AS bw_metadata_last_pro_check, bw_metadata.first_config_saved AS bw_metadata_first_config_saved, bw_metadata.autoconf_loaded AS bw_metadata_autoconf_loaded, bw_metadata.scheduler_first_start AS bw_metadata_scheduler_first_start, bw_metadata.custom_configs_changed AS bw_metadata_custom_configs_changed, bw_metadata.last_custom_configs_change AS bw_metadata_last_custom_configs_change, bw_metadata.external_plugins_changed AS bw_metadata_external_plugins_changed, bw_metadata.last_external_plugins_change AS bw_metadata_last_external_plugins_change, bw_metadata.pro_plugins_changed AS bw_metadata_pro_plugins_changed, bw_metadata.last_pro_plugins_change AS bw_metadata_last_pro_plugins_change, bw_metadata.instances_changed AS bw_metadata_instances_changed, bw_metadata.last_instances_change AS bw_metadata_last_instances_change, bw_metadata.failover AS bw_metadata_failover, bw_metadata.integration AS bw_metadata_integration, bw_metadata.version AS bw_metadata_version 
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: FROM bw_metadata 
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: WHERE bw_metadata.id = %(pk_1)s]
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: [parameters: {'pk_1': 1}]
Nov 18 23:40:11 172.16.1.1 ba333321ce29[26671]: (Background on this error at: https://sqlalche.me/e/20/e3q8)

BunkerWeb version

1.5.11

What integration are you using?

Docker

Linux distribution (if applicable)

No response

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thelittlefireman thelittlefireman added the bug Something isn't working label Nov 18, 2024
@TheophileDiot
Copy link
Member

Hi @thelittlefireman, thank you for opening this issue.
I couldn't reproduce the bug, can you elaborate a bit more on the configuration you had before the upgrade, etc? Thank you

@thelittlefireman
Copy link
Contributor Author

nothing special in my config, it's the same for a very long time. I will copy past it later. Something strang happen, the previous version is identify as error (Database version (error) is different from Bunkerweb version (1.5.11), migrating ... ) see the logs bellow.

i try to delete and recreate the containers with the same DB but still got the same error.

[2024-11-25 23:28:48] - ENTRYPOINT - ℹ️ - Starting the job scheduler v1.5.11 ...
[2024-11-25 23:28:48] - ENTRYPOINT - ℹ️ - Setup and check /data folder ...
[2024-11-25 23:28:48] - ENTRYPOINT - ℹ️  - Executing scheduler ...
[2024-11-25 23:28:53 +0000] [SCHEDULER] [21] [⚠️ ] - Can't connect to database, retrying in 5 seconds ...
[2024-11-25 23:28:58 +0000] [SCHEDULER] [21] [ℹ️ ] - ✅ Database connection established
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Save config started ...
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Settings : /usr/share/bunkerweb/settings.json
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Core : /usr/share/bunkerweb/core
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Plugins : /etc/bunkerweb/plugins
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Pro plugins : /etc/bunkerweb/pro/plugins
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Init : False
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Checking arguments ...
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service gitlab.XXXX.XX with type SERVER_HTTP and name auto-custom-gitlab
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service auth.XXXX.XX with type SERVER_HTTP and name auto-custom-auth
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service prowlarr.XXXX.XX with type SERVER_HTTP and name auto-custom-prowlarr
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service bitwarden.XXXX.XX with type SERVER_HTTP and name auto-custom-bitwarden
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service readarr.XXXX.XX with type SERVER_HTTP and name auto-custom-readarr
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service gitea.XXXX.XX with type SERVER_HTTP and name auto-custom-gitea
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service syno.XXXX.XX with type SERVER_HTTP and name auto-custom-syno
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service sonarr.XXXX.XX with type SERVER_HTTP and name auto-custom-sonarr
[2024-11-25 23:29:00 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service home.XXXX.XX with type SERVER_HTTP and name auto-custom-home
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [ℹ️ ] - ✅ Database connection established
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [ℹ️ ] - Found custom conf env var for service radarr.XXXX.XX with type SERVER_HTTP and name auto-custom-radarr
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [ℹ️ ] - Computing config ...
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [ℹ️ ] - Database is already initialized, checking for changes ...
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [⚠️ ] - Database version (error) is different from Bunkerweb version (1.5.11), migrating ...
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [⚠️ ] - Table "bw_cli_commands" is missing, creating it
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [⚠️ ] - Table "bw_plugins" already exists, dropping it to make room for the new one
/usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
  session.rollback()
[2024-11-25 23:29:01 +0000] [GENERATOR] [28] [❌] - Exception while executing config saver : Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (3730, "Cannot drop table 'bw_plugins_error' referenced by a foreign key constraint 'bw_settings_error_ibfk_1' on table 'bw_settings_error'.")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/share/bunkerweb/gen/save_config.py", line 302, in <module>
    ret, err = db.init_tables(
               ^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/db/Database.py", line 699, in init_tables
    session.execute(text(f"DROP TABLE {table_name}_{db_version_id}"))
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/scoping.py", line 778, in execute
    return self._proxied.execute(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2256, in _execute_internal
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (3730, "Cannot drop table 'bw_plugins_error' referenced by a foreign key constraint 'bw_settings_error_ibfk_1' on table 'bw_settings_error'.")
[SQL: DROP TABLE bw_plugins_error]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

[2024-11-25 23:29:01 +0000] [SCHEDULER] [21] [❌] - Config saver failed, configuration will not work as expected...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Scheduler started ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Checking if there are any changes in custom configs ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Checking if there are any changes in external plugins ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Checking if there are any changes in pro plugins ...
/usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
  session.rollback()
Exception in thread Thread-3 (check_plugin_changes):
Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
Exception in thread Thread-4 (check_plugin_changes):
Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    conn.query(q)
    result = self._query(query)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")

pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")
The above exception was the direct cause of the following exception:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
    self.run()
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1012, in run
  File "/usr/local/lib/python3.12/threading.py", line 1012, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/bunkerweb/scheduler/main.py", line 585, in check_plugin_changes
    self._target(*self._args, **self._kwargs)
  File "/usr/share/bunkerweb/scheduler/main.py", line 585, in check_plugin_changes
    db_plugins = SCHEDULER.db.get_plugins(_type=_type)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/db/Database.py", line 2407, in get_plugins
    db_plugins = SCHEDULER.db.get_plugins(_type=_type)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/db/Database.py", line 2407, in get_plugins
    for command in session.query(BwcliCommands).with_entities(BwcliCommands.name, BwcliCommands.file_name).filter_by(plugin_id=plugin.id):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2813, in __iter__
    for command in session.query(BwcliCommands).with_entities(BwcliCommands.name, BwcliCommands.file_name).filter_by(plugin_id=plugin.id):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2813, in __iter__
    result = self._iter()
    result = self._iter()
             ^^^^^^^^^^^^
             ^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2827, in _iter
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2827, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    result: Result[Any] = compile_state_cls.orm_execute_statement(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
    result = conn.execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
             ^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return meth(
           ^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return connection._execute_clauseelement(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ret = self._execute_context(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
    return self._exec_single_context(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    self.dialect.do_execute(
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
    result = self._query(query)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    first_packet = self.connection._read_packet()
    packet.raise_for_error()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
[SQL: SELECT bw_cli_commands.name AS bw_cli_commands_name, bw_cli_commands.file_name AS bw_cli_commands_file_name 
FROM bw_cli_commands 
WHERE bw_cli_commands.plugin_id = %(plugin_id_1)s]
[parameters: {'plugin_id_1': 'backup_s3'}]
(Background on this error at: https://sqlalche.me/e/20/f405)
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
[SQL: SELECT bw_cli_commands.name AS bw_cli_commands_name, bw_cli_commands.file_name AS bw_cli_commands_file_name 
FROM bw_cli_commands 
WHERE bw_cli_commands.plugin_id = %(plugin_id_1)s]
[parameters: {'plugin_id_1': 'clamav'}]
(Background on this error at: https://sqlalche.me/e/20/f405)
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Removing old custom configs files ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Generating new custom configs ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Sending /etc/bunkerweb/configs folder ...
[2024-11-25 23:29:02 +0000] [API] [21] [ℹ️ ] - Successfully sent API request to http://nginx:5100/custom_configs
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Successfully sent /etc/bunkerweb/configs folder
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Running plugins download jobs ...
[2024-11-25 23:29:02 +0000] [SCHEDULER] [21] [ℹ️ ] - Executing job download-plugins from plugin misc ...
[2024-11-25 23:29:09 +0000] [JOBS.DOWNLOAD-PLUGINS] [75] [ℹ️ ] - ✅ Database connection established
[2024-11-25 23:29:09 +0000] [JOBS.DOWNLOAD-PLUGINS] [75] [ℹ️ ] - Downloading external plugins from https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.6.zip...
/usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
  session.rollback()
[2024-11-25 23:29:09 +0000] [JOBS.DOWNLOAD-PLUGINS] [75] [❌] - Exception while installing plugin(s) from https://github.com/bunkerity/bunkerweb-plugins/archive/refs/tags/v1.6.zip :
Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 159, in <module>
    if install_plugin(plugin_path.parent, db):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/core/misc/jobs/download-plugins.py", line 64, in install_plugin
    for plugin in db.get_plugins(_type="external"):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/db/Database.py", line 2407, in get_plugins
    for command in session.query(BwcliCommands).with_entities(BwcliCommands.name, BwcliCommands.file_name).filter_by(plugin_id=plugin.id):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2813, in __iter__
    result = self._iter()
             ^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 2827, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
[SQL: SELECT bw_cli_commands.name AS bw_cli_commands_name, bw_cli_commands.file_name AS bw_cli_commands_file_name 
FROM bw_cli_commands 
WHERE bw_cli_commands.plugin_id = %(plugin_id_1)s]
[parameters: {'plugin_id_1': 'clamav'}]
(Background on this error at: https://sqlalche.me/e/20/f405)

[2024-11-25 23:29:09 +0000] [JOBS.DOWNLOAD-PLUGINS] [75] [ℹ️ ] - No external plugins to update to database
[2024-11-25 23:29:12 +0000] [SCHEDULER] [21] [ℹ️ ] - Successfully updated database for the job download-plugins from plugin misc
[2024-11-25 23:29:13 +0000] [SCHEDULER] [21] [ℹ️ ] - Executing job download-pro-plugins from plugin pro ...
[2024-11-25 23:29:15 +0000] [JOBS.DOWNLOAD-PRO-PLUGINS] [87] [ℹ️ ] - ✅ Database connection established
[2024-11-25 23:29:15 +0000] [JOBS.DOWNLOAD-PRO-PLUGINS] [87] [ℹ️ ] - Checking BunkerWeb Pro status...
[2024-11-25 23:29:15 +0000] [JOBS.DOWNLOAD-PRO-PLUGINS] [87] [⚠️ ] - Cleaning up Pro plugins...
/usr/share/bunkerweb/db/Database.py:274: SAWarning: transaction already deassociated from connection
  session.rollback()
[2024-11-25 23:29:15 +0000] [JOBS.DOWNLOAD-PRO-PLUGINS] [87] [❌] - Exception while running download-pro-plugins.py :
Traceback (most recent call last):
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'db.bw_cli_commands' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/share/bunkerweb/core/pro/jobs/download-pro-plugins.py", line 178, in <module>
    clean_pro_plugins(db)
  File "/usr/share/bunkerweb/core/pro/jobs/download-pro-plugins.py", line 48, in clean_pro_plugins
    db.update_external_plugins([], _type="pro")
  File "/usr/share/bunkerweb/db/Database.py", line 1856, in update_external_plugins
    session.query(BwcliCommands).filter(BwcliCommands.plugin_id.in_(missing_ids)).delete()
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/query.py", line 3162, in delete
    result: CursorResult[Any] = self.session.execute(
                                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2362, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/session.py", line 2247, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/bulk_persistence.py", line 2021, in orm_execute_statement
    return super().orm_execute_statement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1418, in execute
    return meth(
           ^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1640, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/share/bunkerweb/deps/python/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bunkerweb/deps/python/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/usr/share/bunkerweb/deps/python/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/usr/share/bunkerweb/deps/python/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'db.bw_cli_commands' doesn't exist")
[SQL: DELETE FROM bw_cli_commands WHERE bw_cli_commands.plugin_id IN (%(plugin_id_1_1)s, %(plugin_id_1_2)s, %(plugin_id_1_3)s, %(plugin_id_1_4)s, %(plugin_id_1_5)s, %(plugin_id_1_6)s)]
[parameters: {'plugin_id_1_1': 'backup_s3', 'plugin_id_1_2': 'letsencrypt_dns', 'plugin_id_1_3': 'migration', 'plugin_id_1_4': 'monitoring', 'plugin_id_1_5': 'prometheus_exporter', 'plugin_id_1_6': 'reporting'}]
(Background on this error at: https://sqlalche.me/e/20/f405)

[2024-11-25 23:29:15 +0000] [SCHEDULER] [21] [❌] - Error while executing job download-pro-plugins from plugin pro

@TheophileDiot
Copy link
Member

@thelittlefireman try changing the version in the database metadata and restart all containers:

UPDATE bw_metadata SET version = 'old';

@thelittlefireman
Copy link
Contributor Author

i try but same issue. I also try to upgrade to 1.5.12 but same errors

@thelittlefireman
Copy link
Contributor Author

View of the database

1 row in set (0.00 sec)
       SHOW TABLES;
+----------------------------+
| Tables_in_db               |
+----------------------------+
| bw_cli_commands_1_5_8      |
| bw_cli_commands_1_5_9      |
| bw_cli_commands_error      |
| bw_custom_configs          |
| bw_custom_configs_1_5_8    |
| bw_custom_configs_1_5_9    |
| bw_custom_configs_error    |
| bw_global_values           |
| bw_global_values_1_5_8     |
| bw_global_values_1_5_9     |
| bw_global_values_error     |
| bw_instances               |
| bw_instances_1_5_8         |
| bw_instances_1_5_9         |
| bw_instances_error         |
| bw_jobs                    |
| bw_jobs_1_5_8              |
| bw_jobs_1_5_9              |
| bw_jobs_cache              |
| bw_jobs_cache_1_5_8        |
| bw_jobs_cache_1_5_9        |
| bw_jobs_cache_error        |
| bw_jobs_error              |
| bw_metadata                |
| bw_metadata_1_5_8          |
| bw_metadata_1_5_9          |
| bw_metadata_error          |
| bw_plugin_pages            |
| bw_plugin_pages_1_5_8      |
| bw_plugin_pages_1_5_9      |
| bw_plugin_pages_error      |
| bw_plugins                 |
| bw_plugins_1_5_8           |
| bw_plugins_1_5_9           |
| bw_plugins_error           |
| bw_selects                 |
| bw_selects_1_5_8           |
| bw_selects_1_5_9           |
| bw_selects_error           |
| bw_services                |
| bw_services_1_5_8          |
| bw_services_1_5_9          |
| bw_services_error          |
| bw_services_settings       |
| bw_services_settings_1_5_8 |
| bw_services_settings_1_5_9 |
| bw_services_settings_error |
| bw_settings                |
| bw_settings_1_5_8          |
| bw_settings_1_5_9          |
| bw_settings_error          |
| bw_ui_users                |
| bw_ui_users_1_5_8          |
| bw_ui_users_1_5_9          |
| bw_ui_users_error          |
+----------------------------+
55 rows in set (0.01 sec)

Seems to be older than 1.5.10

@thelittlefireman
Copy link
Contributor Author

thelittlefireman commented Nov 27, 2024

Fix by DROP *_error TABLE; and assert old version is correct in metadata table;

@axeleroy
Copy link

I had the same issue as you and tried your fix but I ended up throwing the towel and nuked the DB to let it re-create to a proper state. It's a radical fix but it worked.

@cositech
Copy link

I also have the same issue but not with the scheduler container but with the ui-container.
This
UPDATE bw_metadata SET version = 'old';
helps just as little as
DROP *_error TABLE;

I hope someone can find a solution to the problem, as several of my instances are now affected.

@TheophileDiot
Copy link
Member

FYI guys we changed this behavior in the 1.6.X release, I'll run some tests and let you know of an easy solution about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants