DB migration failed from 3.8.2 to 3.8.3 or 3.8.4
Author: engyczCreated May 10, 2026Updated Sep 1, 2026
python serve.py
* Importing gevent and monkey patching. Use --disable-gevent to disable.
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running stamp_revision 67ebab6de598 -> 48d8250d19bd
/*\ CTFd has updated and must update the database! /*\
/*\ Please backup your database before proceeding! /*\
/*\ CTFd maintainers are not responsible for any data loss! /*\
Run database migrations (Y/N)y
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1910, in _execute_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, statement, parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 736, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such column: challenges.position
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\j-engelthaler\Downloads\CTFd\serve.py", line 23, in <module>
app = create_app()
File "C:\Users\j-engelthaler\Downloads\CTFd\CTFd\__init__.py", line 315, in create_app
update_check(force=True)
~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\j-engelthaler\Downloads\CTFd\CTFd\\\utils\\\updates\__init__.py", line 50, in update_check
"challenge_count": Challenges.query.count(),
~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\orm\query.py", line 3176, in count
return self._from_self(col).enable_eagerloads(False).scalar()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2893, in scalar
ret = self.one()
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2870, in one
return self._iter().one()
~~~~~~~~~~^^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\orm\query.py", line 2916, in _iter
result = self.session.execute(
statement,
params,
execution_options={"_sa_orm_load_options": self.load_options},
)
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1717, in execute
result = conn._execute_20(statement, params or {}, execution_options)
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1710, in _execute_20
return meth(self, args_10style, kwargs_10style, execution_options)
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\sql\elements.py", line 334, in _execute_on_connection
return connection._execute_clauseelement(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self, multiparams, params, execution_options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1577, in _execute_clauseelement
ret = self._execute_context(
dialect,
...<8 lines>...
cache_hit=cache_hit,
)
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1953, in _execute_context
self._handle_dbapi_exception(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
e, statement, parameters, cursor, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2134, in _handle_dbapi_exception
util.raise_(
~~~~~~~~~~~^
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\\\util\compat.py", line 211, in raise_
raise exception
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 1910, in _execute_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, statement, parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\j-engelthaler\Downloads\CTFd-3.8.4\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 736, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: challenges.position
[SQL: SELECT count(*) AS count_1
FROM (SELECT challenges.id AS challenges_id, challenges.name AS challenges_name, challenges.description AS challenges_description, challenges.attribution AS challenges_attribution, challenges.connection_info AS challenges_connection_info, challenges.next_id AS challenges_next_id, challenges.max_attempts AS challenges_max_attempts, challenges.value AS challenges_value, challenges.category AS challenges_category, challenges.type AS challenges_type, challenges.state AS challenges_state, challenges.logic AS challenges_logic, challenges.initial AS challenges_initial, challenges.minimum AS challenges_minimum, challenges.decay AS challenges_decay, challenges.position AS challenges_position, challenges.function AS challenges_function, challenges.requirements AS challenges_requirements
FROM challenges) AS anon_1]
(Background on this error at: https://sqlalche.me/e/14/e3q8)Source: CTFd/CTFd