Skip to content

[Auto Exception] OperationalError: (sqlite3.OperationalError) no such column: tournaments.creation_token [SQL: SELECT count(*) AS count_1 FROM (SELECT tou #189

Description

@Manishrdy

Automated issue created from exception logger.

  • Type: OperationalError
  • Message: (sqlite3.OperationalError) no such column: tournaments.creation_token [SQL: SELECT count(*) AS count_1 FROM (SELECT tournaments.id AS tournaments_id, tournaments.user_id AS tournaments_user_id, tournaments.name AS tournaments_name, tournaments.status AS tournaments_status, tournaments.created_at AS tournaments_created_at, tournaments.creation_token AS tournaments_creation_token, tournaments.mode AS tournaments_mode, tournaments.format_type AS tournaments_format_type, tournaments.current_stage A
  • Severity: error
  • Source: backend
  • User: <email>
  • Request ID: d778b832e5cb
  • Timestamp (UTC): 2026-09-18 21:34:46.038799

Context

{
  "path": "/",
  "method": "GET",
  "endpoint": "home",
  "remote_addr": "<ip>"
}

Traceback

Traceback (most recent call last):
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
    self.dialect.do_execute(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        cursor, str_statement, effective_parameters, context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
    cursor.execute(statement, parameters)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such column: tournaments.creation_token

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

Traceback (most recent call last):
  File "/Users/manish/Documents/SimCricketX/app.py", line 830, in inject_user_stats
    'tournaments_count': db.session.query(Tournament).filter_by(user_id=current_user.id).count(),
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/query.py", line 3153, in count
    self._legacy_from_self(col).enable_eagerloads(False).scalar()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/query.py", line 2842, in scalar
    ret = self.one()
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/query.py", line 2815, in one
    return self._iter().one()  # type: ignore
           ~~~~~~~~~~^^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/query.py", line 2864, in _iter
    result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                  ~~~~~~~~~~~~~~~~~~~~^
        statement,
        ^^^^^^^^^^
        params,
        ^^^^^^^
        execution_options={"_sa_orm_load_options": self.load_options},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/session.py", line 2373, in execute
    return self._execute_internal(
           ~~~~~~~~~~~~~~~~~~~~~~^
        statement,
        ^^^^^^^^^^
    ...<4 lines>...
        _add_event=_add_event,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/session.py", line 2271, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self,
        ^^^^^
    ...<4 lines>...
        conn,
        ^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/orm/context.py", line 306, in orm_execute_statement
    result = conn.execute(
        statement, params or {}, execution_options=execution_options
    )
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1421, in execute
    return meth(
        self,
        distilled_parameters,
        execution_options or NO_OPTIONS,
    )
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
    return connection._execute_clauseelement(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self, distilled_params, execution_options
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1643, in _execute_clauseelement
    ret = self._execute_context(
        dialect,
    ...<8 lines>...
        cache_hit=cache_hit,
    )
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1848, in _execute_context
    return self._exec_single_context(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        dialect, context, statement, parameters
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context
    self._handle_dbapi_exception(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        e, str_statement, effective_parameters, cursor, context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 2365, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/Users/manish/Documents/SimCricketX/.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context
    self.dialect.do_execute(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        cursor, 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions