-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
After celery lib upgrade to 5.3.3, get sql exception. #8470
Comments
Rollback to 5.3.1 version resolved the exception. |
UndefinedColumn can be seen, can you check the logs to find what commit caused this? |
Maybe this? #8338
|
since that introduced a new model field, that field need to be applied on DB as well! missing migrations strikes here most probably! |
This is a bit of a big deal, I agree. |
@Pokerface9711 Thank you for the report! ❤️ |
I will handle that. lets wait |
I ran into this with Airflow 2.7.0 when I updated without using constraints:
|
Question - we are about to release Airflow 2.7.1 with limitted constraints and we will exclude both 5.3.2, 5.3.3 from our celery provider requirements - assuming that it will be fixed by added migrations to celery in 5.3.4. Is it a sound assumption :)? |
I would suggest sticking with celery 5.3.1 for that and wait for a new celery point release with proper schema migrations support! |
Slightly off-topic but FYI - Just in case you might be interested how it works for us @auvipy: this is what effectively we did by setting our The way how airflow dependencies work - we do not "pin" dependencies (because airflow is both library and applicaiton) - we produce constraint files that can be use to make sure the installation is reproducible, but we do not limit the dependencies to be upgraded separately (for example to make it possible to update to newer versions with bugfixes and new features and security fixes). We have a complete mechanism to automatically build the set of constraints for airflow when released. Any by excluding 5.3.2 and 5.3.3 our constraints automatically landed at 5.3.1. See main and 2.7 branch constraints automatically pushed by our CI. Also we realised that the sqlalchemy configuration of celery is not (yet) "integration tested" by Airflow and we added a task for that apache/airflow#34032 otherwise we would have detected this isssue a bit earlier (basically right after release). but whenever you release 5.3.4 we will run our tests and when they pass we will upgrade our constraints to 5.3.4 (all fully automated). We have 650 transitive dependencies in total,so we had to automate it :) . We very rarely upper-bind the releases, only when we know that they can cause big issues (for example we now have celery Also as discussed in apache/airflow#34031 (comment) PyPI has protections against re-releasing already released versions (so celery will have to go with 5.3.4 effectively) so - all is cool I think for us. So effectively: we are sticking with 5.3.1 as you suggested, while we are stil open to upgrade to new versions of celery automaticaly when it happens. |
yes I learnt from PyPI today that we can't release a same version again! we yanked them and will release 5.3.4 very soon. |
To clarify - yanking makes the files remain available on PyPI for anyone explicitly wanting them, and installaser are meant to ignore yanked versions unless made explicit via 5.3.2 and 5.3.3 were deleted from PyPI - so anyone who opted in to using these would now have a broken dependency chain. Thanks for performing new releases with fixes in 5.3.4, but something to consider in the future. |
yes that is what we learned yesterday and will follow along. |
this should be fixed in 5.3.4/5.3.5 release already, right? @Nusnus we did some revert |
could this problem be related to this one? |
Checklist
main
branch of Celery.contribution guide
on reporting bugs.
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the main branch.
in this issue (If there are none, check this box anyway).
Mandatory Debugging Information
celery -A proj report
in the issue.(if you are not able to do this, then at least specify the Celery
version affected).
main
branch of Celery.pip freeze
in the issue.to reproduce this bug.
Optional Debugging Information
and/or implementation.
result backend.
broker and/or result backend.
ETA/Countdown & rate limits disabled.
and/or upgrading Celery and its dependencies.
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Environment & Settings
Celery version:
celery report
Output:Steps to Reproduce
Required Dependencies
Python Packages
pip freeze
Output:Other Dependencies
N/A
Minimally Reproducible Test Case
Expected Behavior
Actual Behavior
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/billiard/pool.py", line 1793, in safe_apply_callback
fun(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/celery/worker/request.py", line 624, in on_failure
self.task.backend.mark_as_failure(
File "/usr/local/lib/python3.8/site-packages/celery/backends/base.py", line 167, in mark_as_failure
self.store_result(task_id, exc, state,
File "/usr/local/lib/python3.8/site-packages/celery/backends/base.py", line 526, in store_result
self._store_result(task_id, result, state, traceback,
File "/usr/local/lib/python3.8/site-packages/celery/backends/database/init.py", line 47, in _inner
return fun(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/celery/backends/database/init.py", line 117, in _store_result
task = list(session.query(self.task_cls).filter(self.task_cls.task_id == task_id))
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2861, in iter
result = self._iter()
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 2875, in _iter
result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2229, in execute
return self._execute_internal(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2124, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/context.py", line 252, in orm_execute_statement
result = conn.execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1414, in execute
return meth(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 489, in _execute_on_connection
return connection._execute_clauseelement(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1842, in _execute_context
return self._exec_single_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1983, in _exec_single_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2325, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 747, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column celery_taskmeta.children does not exist
LINE 1: ..._taskmeta.traceback AS celery_taskmeta_traceback, celery_tas...
^
[SQL: SELECT celery_taskmeta.id AS celery_taskmeta_id, celery_taskmeta.task_id AS celery_taskmeta_task_id, celery_taskmeta.status AS celery_taskmeta_status, celery_taskmeta.result AS celery_taskmeta_result, celery_taskmeta.date_done AS celery_taskmeta_date_done, celery_taskmeta.traceback AS celery_taskmeta_traceback, celery_taskmeta.children AS celery_taskmeta_children
FROM celery_taskmeta
WHERE celery_taskmeta.task_id = %(task_id_1)s]
[parameters: {'task_id_1': 'b9e469f3-e53c-4243-92aa-adeaaf5a9757'}]
(Background on this error at: https://sqlalche.me/e/20/f405)
The text was updated successfully, but these errors were encountered: