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

Helm "fakedata" Fails #3

Open
jtdroste opened this issue Feb 12, 2025 · 1 comment
Open

Helm "fakedata" Fails #3

jtdroste opened this issue Feb 12, 2025 · 1 comment

Comments

@jtdroste
Copy link

Howdy,

With the following values.yaml file:

scot4:
  clean_flair_install: "false"
  wipe_api_database: "true"
  rebuild_api_database_tables: "false"

  api:
    internalDB: "true"
    fakedata: "true"

The job scot4-api-db-management is failing. Specifically, the scot4-api-fake-data container says:

2025-02-12 22:16:24.509 | INFO     | __main__:main:46 - Create initial data
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/connection_cext.py", line 706, in cmd_query
    self._cmysql.query(
_mysql_connector.MySQLInterfaceError: Table 'scot4'.'alerts' was skipped since its definition is being modified by concurrent DDL statement

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/cursor_cext.py", line 357, in execute
    result = self._connection.cmd_query(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/opentelemetry/context_propagation.py", line 97, in wrapper
    return method(cnx, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/connection_cext.py", line 714, in cmd_query
    raise get_mysql_exception(
mysql.connector.errors.DatabaseError: 1684 (HY000): Table 'scot4'.'alerts' was skipped since its definition is being modified by concurrent DDL statement

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

Traceback (most recent call last):
  File "/code/./tests/utils/initial_data.py", line 476, in <module>
    main()
  File "/code/./tests/utils/initial_data.py", line 48, in main
    init_db(db_session, True, True, True)
  File "/code/app/db/init_db.py", line 62, in init_db
    base.Base.metadata.drop_all(bind=db_session.bind)
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/schema.py", line 5894, in drop_all
    bind._run_ddl_visitor(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3253, in _run_ddl_visitor
    conn._run_ddl_visitor(visitorcallable, element, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2459, in _run_ddl_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/visitors.py", line 664, in traverse_single
    return meth(obj, **kw)
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 1018, in visit_metadata
    unsorted_tables = [t for t in tables if self._can_drop_table(t)]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 1018, in <listcomp>
    unsorted_tables = [t for t in tables if self._can_drop_table(t)]
                                            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 1094, in _can_drop_table
    return not self.checkfirst or self.dialect.has_table(
                                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in has_table
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/reflection.py", line 88, in cache
    return fn(self, con, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/base.py", line 2754, in has_table
    with connection.exec_driver_sql(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1779, in exec_driver_sql
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2355, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 941, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/cursor_cext.py", line 357, in execute
    result = self._connection.cmd_query(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/opentelemetry/context_propagation.py", line 97, in wrapper
    return method(cnx, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mysql/connector/connection_cext.py", line 714, in cmd_query
    raise get_mysql_exception(
sqlalchemy.exc.DatabaseError: (mysql.connector.errors.DatabaseError) 1684 (HY000): Table 'scot4'.'alerts' was skipped since its definition is being modified by concurrent DDL statement
[SQL: DESCRIBE `scot4`.`alerts`]
(Background on this error at: https://sqlalche.me/e/20/4xp6)
@jtdroste
Copy link
Author

As a note, for some reason the scot4-api-create-and-wipe-db-tables job works - and it looks like it's calling the same codepath. Not sure why it's breaking when enabling fakedata.

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

No branches or pull requests

1 participant