celery / celery

Distributed Task Queue (development branch)
https://docs.celeryq.dev
Other
24.61k stars 4.65k forks source link

query_task does not return task #5321

Open NadavK opened 5 years ago

NadavK commented 5 years ago

Checklist

Environment & Settings

Celery version: 4.2.1 (windowlicker) Report:

``` $ 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 open software -> 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'] ```

Steps to Reproduce

Required Dependencies

Python Packages

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

Other Dependencies

N/A

Minimally Reproducible Test Case

```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 {}

auvipy commented 5 years ago

whats its update with celery 4.3?

auvipy commented 5 years ago

will reopen after feedback

gomeslucasm commented 2 years ago

any updated? I'm experiencing the same problem, the task appears using .scheduled() but doesn't appear when I use .query_task(id)

auvipy commented 2 years ago

can you provide more detail please