Repository navigation
Description
Checklist
- I have included the output of
celery -A proj reportin the issue. - I have included the contents of
pip freezein the issue. - I have verified that the issue exists against the
masterbranch of Celery. - I have tried reproducing the issue on more than one message broker and/or result backend.
- I have tried reproducing the issue on more than one workers pool.
- I have tried reproducing the issue with retries, ETA/Countdown & rate limits disabled.
Environment & Settings
Celery version: 4.2.1 (windowlicker)
Report:
Details
``` $ celery -A djhome report DEBUG [2019-02-04 17:55:09,071] asyncio: Using selector: EpollSelector DEBUG [2019-02-04 17:55:10,564] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@djhome-dev', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US'] DEBUG [2019-02-04 17:55:10,570] amqp: using channel_id: 1 DEBUG [2019-02-04 17:55:10,579] amqp: Channel open DEBUG [2019-02-04 17:55:10,679] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@djhome-dev', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US'] DEBUG [2019-02-04 17:55:10,684] amqp: using channel_id: 1 DEBUG [2019-02-04 17:55:10,689] amqp: Channel opensoftware -> celery:4.2.1 (windowlicker) kombu:4.2.2-post1 py:3.6.8
billiard:3.5.0.3 py-amqp:2.2.2
platform -> system:Linux arch:32bit, ELF imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:disabled
ABSOLUTE_URL_OVERRIDES: {
}
CACHES: {
'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS: 'default'
CACHE_MIDDLEWARE_KEY_PREFIX: ''
CACHE_MIDDLEWARE_SECONDS: 600
CELERYD_LOG_LEVEL: 'INFO'
CELERYD_TIMER_PRECISION: 0.5
CELERY_ACCEPT_CONTENT: ['json']
CELERY_BROKER_URL: 'amqp://guest:@localhost:5672//'
CELERY_IGNORE_RESULT: True
CELERY_TASK_IGNORE_RESULT: True
CELERY_TASK_SERIALIZER: 'json'
CELERY_TIMEZONE: 'Asia/Jerusalem'
CHANNEL_LAYERS: {
'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [('127.0.0.1', 6379)]}},
'default_old': { 'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'capacity': 1000, 'prefix': 'mysite'}}}
DEBUG: True
DEBUG_PROPAGATE_EXCEPTIONS: False
DECIMAL_SEPARATOR: '.'
FILE_CHARSET: 'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS: None
FILE_UPLOAD_HANDLERS: ['django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE: 2621440
FILE_UPLOAD_PERMISSIONS: None
FILE_UPLOAD_TEMP_DIR: None
FIRST_DAY_OF_WEEK: 0
FIXTURE_DIRS:
('fixtures/',)
FORCE_SCRIPT_NAME: None
FORMAT_MODULE_PATH: None
FORM_RENDERER: 'django.forms.renderers.DjangoTemplates'
GENERATE_REQUEST_ID_IF_NOT_IN_HEADER: True
IGNORABLE_404_URLS: []
INSTALLED_APPS: ['channels',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'taggit',
'guardian',
'rest_framework',
'rest_framework.authtoken']
INTERNAL_IPS: []
JWT_AUTH: {
'JWT_ALLOW_REFRESH': True,
'JWT_EXPIRATION_DELTA': datetime.timedelta(14),
'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(36500),
'JWT_VERIFY_EXPIRATION': False}
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE: None
MIDDLEWARE_CLASSES: ['log_request_id.middleware.RequestIDMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.common.BrokenLinkEmailsMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
</details>
# Steps to Reproduce
## Required Dependencies
<!-- Please fill the required dependencies to reproduce this issue -->
* **Minimal Python Version**: N/A or Unknown
* **Minimal Broker Version**: N/A or Unknown
* **Minimal Result Backend Version**: N/A or Unknown
* **Minimal OS and/or Kernel Version**: : N/A or Unknown
### Python Packages
<!-- Please fill the contents of pip freeze below -->
<details>
aioredis==1.2.0
amqp==2.2.2
appdirs==1.4.3
argh==0.26.2
arrow==0.10.0
asgiref==2.3.2
astral==1.7.1
async-timeout==3.0.1
attrs==18.2.0
autobahn==17.10.1
Automat==0.6.0
Babel==2.5.1
backports-abc==0.5
backports.ssl-match-hostname==3.5.0.1
billiard==3.5.0.3
blessed==1.14.2
celery==4.2.1
certifi==2017.11.5
channels==2.1.6
channels-redis==2.3.3
chardet==3.0.4
chaussette==1.3.0
cheroot==5.10.0
CherryPy==12.0.1
circus==0.15.0
constantly==15.1.0
daphne==2.2.4
Django==1.11.7
django-cors-headers==2.4.0
django-filter==1.1.0
django-guardian==1.4.9
django-log-request-id==1.3.2
django-picklefield==1.0.0
django-taggit==0.22.1
django-taggit-serializer==0.1.5
djangorestframework==3.9.1
djangorestframework-jwt==1.11.0
flower==0.9.2
future==0.16.0
greenlet==0.4.12
gunicorn==19.7.1
hiredis==0.3.1
hyperlink==17.3.1
idna==2.6
incremental==17.5.0
jaraco.classes==1.4.3
kombu==4.2.2.post1
Markdown==2.6.9
meld3==1.0.2
msgpack==0.6.0
msgpack-python==0.4.8
packaging==16.8
parsedatetime==2.4
pathtools==0.1.2
Phidget22==1.0.0
portend==2.2
psutil==5.4.8
pydevd==1.1.1
PyHamcrest==1.9.0
PyJWT==1.7.1
pyluach==0.3.0.dev1
pyparsing==2.2.0
python-dateutil==2.6.1
pytz==2018.7
PyYAML==3.12
pyzmq==16.0.4
redis==2.10.6
requests==2.18.4
requests-futures==0.9.7
singledispatch==3.4.0.3
six==1.11.0
SQLAlchemy==1.1.15
tempora==1.9
tornado==4.5.2
Twisted==18.9.0
txaio==18.8.1
urllib3==1.22
vine==1.1.4
wcwidth==0.1.7
zope.interface==4.6.0
</details>
### Other Dependencies
<!--
Please provide system dependencies, configuration files
and other dependency information if applicable
-->
<details>
N/A
</details>
## Minimally Reproducible Test Case
<!--
Please provide a reproducible test case.
Refer to the Reporting Bugs section in our contribution guide.
We prefer submitting test cases in the form of a PR to our integration test suite.
If you can provide one, please mention the PR number below.
If not, please attach the most minimal code example required to reproduce the issue below.
If there test case is too large, please include a link to a gist or a repository below.
-->
<details>
```python
$ celery -A proj inspect scheduled
DEBUG [2019-02-04 20:24:58,358] [none] asyncio: Using selector: EpollSelector
DEBUG [2019-02-04 20:24:59,891] [none] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@proj', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
DEBUG [2019-02-04 20:24:59,898] [none] amqp: using channel_id: 1
DEBUG [2019-02-04 20:24:59,908] [none] amqp: Channel open
DEBUG [2019-02-04 20:25:00,027] [none] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@proj', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
DEBUG [2019-02-04 20:25:00,033] [none] amqp: using channel_id: 1
DEBUG [2019-02-04 20:25:00,038] [none] amqp: Channel open
-> celery@proj: OK
* {'eta': '2019-02-04T21:00:00+02:00', 'priority': 6, 'request': {'id': '5b3fc76e-df3a-4d5c-b46c-66557f00879f', 'name': 'proj.celery.set_from_schedule', 'args': "(22)", 'kwargs': '{}', 'type': 'proj.celery.set_output_state_from_schedule', 'hostname': 'celery@proj', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': False}, 'worker_pid': None}}
$ celery -A proj inspect query_task
DEBUG [2019-02-04 20:27:39,477] [none] asyncio: Using selector: EpollSelector
DEBUG [2019-02-04 20:27:41,056] [none] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@proj', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
DEBUG [2019-02-04 20:27:41,063] [none] amqp: using channel_id: 1
DEBUG [2019-02-04 20:27:41,074] [none] amqp: Channel open
DEBUG [2019-02-04 20:27:41,176] [none] amqp: Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@proj', 'copyright': 'Copyright (C) 2007-2016 Pivotal Software, Inc.', 'information': 'Licensed under the MPL. See http://www.rabbitmq.com/', 'platform': 'Erlang/OTP', 'product': 'RabbitMQ', 'version': '3.6.6'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
DEBUG [2019-02-04 20:27:41,182] [none] amqp: using channel_id: 1
DEBUG [2019-02-04 20:27:41,188] [none] amqp: Channel open
-> celery@proj: OK
{}
Expected Behavior
Calling "inspect scheduled" correctly returns tasks.
I expect that "inspect query_task" on a specific task_id will return that task, but it returns {}
Actual Behavior
"inspect query_task" on a specific task_id returns {}
Activity
auvipy commentedon Apr 30, 2019
whats its update with celery 4.3?
auvipy commentedon May 6, 2019
will reopen after feedback
gomeslucasm commentedon Feb 18, 2022
any updated? I'm experiencing the same problem, the task appears using
.scheduled()but doesn't appear when I use.query_task(id)auvipy commentedon Feb 19, 2022
can you provide more detail please
ghirailghiro commentedon Aug 29, 2026
Hi @auvipy reproduced this on main. The issue is that query_task looks up celery.worker.state.requests, but a task with an eta/countdown doesn't get added there until the ETA actually fires — before that it only exists in the consumer's timer, which is what scheduled reads from. So scheduled() sees it right away, query_task(id) returns nothing until it's about to run.
Opened a fix here: #10535
Here the code to reproduce the error:
auvipy commentedon Aug 31, 2026
cool! thanks lets continue in the pr
auvipy commentedon Sep 1, 2026
may be part of this reproducer can be used as integration test
Add integration and smoke tests for the ETA/countdown query_task fix (c…
Address PR celery#10535 review feedback for celery#5321
Fix: query_task doesn't find tasks scheduled with an ETA/countdown (#…
Fix: query_task doesn't find tasks scheduled with an ETA/countdown (c…