Issue 1:
Checklist

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

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 version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: 4.3.0 (rhubarb)

celery report Output:

root@669cb7056665:/code# celery -A cbleads report

software -> celery:4.3.0 (rhubarb) kombu:4.6.4 py:3.7.1
billiard:3.6.1.0 py-amqp:2.5.1
platform -> system:Linux arch:64bit
kernel version:4.15.0-58-generic imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:amqp://guest:**@rabbitmq:5672/local

ABSOLUTE_URL_OVERRIDES: {
}
ADMINS: [('Surefyre Admin', 'admin@surefyre.co')]
ALLOWED_HOSTS: ['*']
APPEND_SLASH: True
ATTACHMENT_UPLOAD_TAG: 'uploaded'
AUTHENTICATION_BACKENDS: ['sf_user.backends.RoleBackend']
AUTH_PASSWORD_VALIDATORS: '********'
AUTH_USER_MODEL: 'sf_user.User'
AVAILABLE_ACTIONS: {
'licenses.BusinessLead': { 'Tag account with import date': 'site_utils.actions.tag_now'},
'licenses.GroupLead': { 'Tag account with import date': 'site_utils.actions.tag_now'},
'licenses.Lead': { 'Tag account with import date': 'site_utils.actions.tag_now'},
'licenses.Person': { 'Tag account with import date': 'site_utils.actions.tag_now'},
'licenses.PersonalLead': { 'Tag account with import date': 'site_utils.actions.tag_now'},
'product.Product': { 'Generate commission for policies': 'site_utils.actions.generate_commission',
'Tag product with import date': 'site_utils.actions.tag_now'}}
BASE_DIR: '/code'
CACHES: {
'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'KEY_PREFIX': '********',
'LOCATION': 'memcached:11211'}}
CACHE_MIDDLEWARE_ALIAS: 'default'
CACHE_MIDDLEWARE_KEY_PREFIX: '********'
CACHE_MIDDLEWARE_SECONDS: 600
CELERY_ACCEPT_CONTENT: ['json']
CELERY_BEAT_SCHEDULE: {
'check_mailgun_events': { 'options': {'queue': 'celery'},
'schedule': 30,
'task': 'cal.tasks.check_mailgun_events'}}
CELERY_BROKER_URL: 'amqp://guest:********@rabbitmq:5672/local'
CELERY_ENABLE_UTC: False
CELERY_RESULT_BACKEND: 'amqp://guest:********@rabbitmq:5672/local'
CELERY_RESULT_SERIALIZER: 'json'
CELERY_TASK_SERIALIZER: 'json'
CELERY_TIMEZONE: 'America/Los_Angeles'
COMMENTS_APP: 'sf_comment'
COMMENTS_TIMEOUT: 2592000
COMMENTS_XTD_CONFIRM_EMAIL: False
COMMENTS_XTD_MAX_THREAD_LEVEL: 5
COMMENT_ID_REGEX: 'comment_id:(\\d+)'
COMMENT_MAX_LENGTH: 50000
COMMENT_TAGGED_USER_FORMAT: '@[{}]'
COMMENT_TAGGED_USER_REGEX: '@\\[(.*?)\\]'
COMPRESS_CACHEABLE_PRECOMPILERS:
()
COMPRESS_CACHE_BACKEND: 'default'
COMPRESS_CACHE_KEY_FUNCTION: '********'
COMPRESS_CLEAN_CSS_ARGUMENTS: ''
COMPRESS_CLEAN_CSS_BINARY: 'cleancss'
COMPRESS_CLOSURE_COMPILER_ARGUMENTS: ''
COMPRESS_CLOSURE_COMPILER_BINARY: 'java -jar compiler.jar'
COMPRESS_CSS_COMPRESSOR: 'compressor.css.CssCompressor'
COMPRESS_CSS_FILTERS: ['compressor.filters.css_default.CssAbsoluteFilter']
COMPRESS_CSS_HASHING_METHOD: 'mtime'
COMPRESS_DATA_URI_MAX_SIZE: 1024
COMPRESS_DEBUG_TOGGLE: None
COMPRESS_ENABLED: True
COMPRESS_JINJA2_GET_ENVIRONMENT: <function CompressorConf.JINJA2_GET_ENVIRONMENT at 0x7f5505488bf8>
COMPRESS_JS_COMPRESSOR: 'compressor.js.JsCompressor'
COMPRESS_JS_FILTERS: ['compressor.filters.jsmin.JSMinFilter']
COMPRESS_MINT_DELAY: 30
COMPRESS_MTIME_DELAY: 10
COMPRESS_OFFLINE: True
COMPRESS_OFFLINE_CONTEXT: {
'STATIC_URL': 'https://d3b1h6mzvq0bay.cloudfront.net/static/1.112/'}
COMPRESS_OFFLINE_MANIFEST: 'manifest.json'
COMPRESS_OFFLINE_TIMEOUT: 31536000
COMPRESS_OUTPUT_DIR: 'CACHE'
COMPRESS_PARSER: 'compressor.parser.AutoSelectParser'
COMPRESS_PRECOMPILERS:
(('text/javascript',
'npx babel {infile} '
'--presets=/code/js/build-dependencies/node_modules/babel-preset-es2015 '
'--out-file {outfile}'),)
COMPRESS_REBUILD_TIMEOUT: 2592000
COMPRESS_ROOT: '/code/static'
COMPRESS_STORAGE: 'site_utils.storage.S3StaticStorage'
COMPRESS_TEMPLATE_FILTER_CONTEXT: {
'STATIC_URL': 'https://d3b1h6mzvq0bay.cloudfront.net/static/1.112/'}
COMPRESS_URL: 'https://d3b1h6mzvq0bay.cloudfront.net/static/1.112/'
COMPRESS_URL_PLACEHOLDER: '/__compressor_url_placeholder__/'
COMPRESS_VERBOSE: False
COMPRESS_YUGLIFY_BINARY: 'yuglify'
COMPRESS_YUGLIFY_CSS_ARGUMENTS: '--terminal'
COMPRESS_YUGLIFY_JS_ARGUMENTS: '--terminal'
COMPRESS_YUI_BINARY: 'java -jar yuicompressor.jar'
COMPRESS_YUI_CSS_ARGUMENTS: ''
COMPRESS_YUI_JS_ARGUMENTS: ''
CORS_ORIGIN_WHITELIST: []
CRISPY_FAIL_SILENTLY: False
CRISPY_TEMPLATE_PACK: 'bootstrap4'
CSRF_COOKIE_AGE: 31449600
CSRF_COOKIE_DOMAIN: None
CSRF_COOKIE_HTTPONLY: False
CSRF_COOKIE_NAME: 'csrftoken'
CSRF_COOKIE_PATH: '/'
CSRF_COOKIE_SECURE: False
CSRF_FAILURE_VIEW: 'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME: 'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS: []
CSRF_USE_SESSIONS: False
CURRENCIES:
('USD',)
DATABASE_ROUTERS: '********'
DATA_UPLOAD_MAX_MEMORY_SIZE: 2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS: 5000
DATETIME_FORMAT: 'N j, Y, P'
DATETIME_INPUT_FORMATS: ['%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y',
'%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d']
DATE_FORMAT: 'N j, Y'
DATE_INPUT_FORMATS: ['%m/%d/%Y', '%m/%d/%y', '%Y-%m-%d']
DBSETTINGS_VALUE_LENGTH: 20000
DEBUG: False
DEBUG_PROPAGATE_EXCEPTIONS: False
DECIMAL_SEPARATOR: '.'
DEFAULT_CHARSET: 'utf-8'
DEFAULT_CONTENT_TYPE: 'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER: 'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE: 'site_utils.storage.S3MediaStorage'
DEFAULT_FROM_EMAIL: 'fyre-prod@surefyre.co'
DEFAULT_INDEX_TABLESPACE: ''
DEFAULT_TABLESPACE: ''
DISALLOWED_USER_AGENTS: []
EMAIL_SUBJECT_PREFIX: '[Django] '
EMAIL_TIMEOUT: None
EMAIL_USE_LOCALTIME: False
EMAIL_USE_SSL: False
EMAIL_USE_TLS: True
ESL_HOSTNAME: '127.0.0.1'
ESL_PORT: '8021'
ESL_SECRET: '********'
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: ['cbleads.formats']
FORM_RENDERER: 'django.forms.renderers.DjangoTemplates'
FROALA_EDITOR_OPTIONS: {
'enter': 1,
'heightMin': 100,
'imageOutputSize': True,
'key': '********',
'linkAutoPrefix': '',
'linkList': [{'href': '%unsubscribe_url%', 'text': 'Unsubscribe'}]}
FROALA_EDITOR_PLUGINS:
('align',
'char_counter',
'code_beautifier',
'code_view',
'colors',
'draggable',
'emoticons',
'entities',
'file',
'font_family',
'font_size',
'fullscreen',
'help',
'image',
'image_manager',
'inline_style',
'line_breaker',
'link',
'lists',
'paragraph_format',
'paragraph_style',
'print',
'quick_insert',
'quote',
'save',
'special_characters',
'table',
'url',
'video',
'word_paste')
FROALA_INCLUDE_JQUERY: False
FROALA_JS_COOKIE: True
FROALA_STORAGE_BACKEND: 'site_utils.storage.S3PublicMediaStorage'
FULLCAL_DEFAULT_COLOR: '#3a87ad'
FULLCAL_EVENT_COLOR: '#66DDAA'
FULLCAL_TASK_COLOR: '#FF7F50'
GRAPPELLI_ADMIN_TITLE: 'Surefyre Admin'
HIJACK_ALLOW_GET_REQUESTS: True
HIJACK_LOGIN_REDIRECT_URL: '/'
HIJACK_LOGOUT_REDIRECT_URL: '/admin/sf_user/user/'
HIJACK_USE_BOOTSTRAP: True
ICAL_PAST_TASK_CUTOFF: datetime.timedelta(days=180)
IGNORABLE_404_URLS: []
INSTALLED_APPS:
('grappelli',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'haystack',
'licenses',
'settings',
'scraper',
'crispy_forms',
'sf_comment',
'django_comments',
'django.contrib.sites',
'stronghold',
'claim')
INTERNAL_IPS: []
LANGUAGES: [('af', 'Afrikaans'),
('ar', 'Arabic'),
('ast', 'Asturian'),
('az', 'Azerbaijani'),
('bg', 'Bulgarian'),
('be', 'Belarusian'),
('bn', 'Bengali'),
('br', 'Breton'),
('bs', 'Bosnian'),
('ca', 'Catalan'),
('cs', 'Czech'),
('cy', 'Welsh'),
('da', 'Danish'),
('de', 'German'),
('dsb', 'Lower Sorbian'),
('el', 'Greek'),
('en', 'English'),
('en-au', 'Australian English'),
('en-gb', 'British English'),
('eo', 'Esperanto'),
('es', 'Spanish'),
('es-ar', 'Argentinian Spanish'),
('es-co', 'Colombian Spanish'),
('es-mx', 'Mexican Spanish'),
('es-ni', 'Nicaraguan Spanish'),
('es-ve', 'Venezuelan Spanish'),
('et', 'Estonian'),
('eu', 'Basque'),
('fa', 'Persian'),
('fi', 'Finnish'),
('fr', 'French'),
('fy', 'Frisian'),
('ga', 'Irish'),
('gd', 'Scottish Gaelic'),
('gl', 'Galician'),
('he', 'Hebrew'),
('hi', 'Hindi'),
('hr', 'Croatian'),
('hsb', 'Upper Sorbian'),
('hu', 'Hungarian'),
('ia', 'Interlingua'),
('id', 'Indonesian'),
('io', 'Ido'),
('is', 'Icelandic'),
('it', 'Italian'),
('ja', 'Japanese'),
('ka', 'Georgian'),
('kk', 'Kazakh'),
('km', 'Khmer'),
('kn', 'Kannada'),
('ko', 'Korean'),
('lb', 'Luxembourgish'),
('lt', 'Lithuanian'),
('lv', 'Latvian'),
('mk', 'Macedonian'),
('ml', 'Malayalam'),
('mn', 'Mongolian'),
('mr', 'Marathi'),
('my', 'Burmese'),
('nb', 'Norwegian Bokmål'),
('ne', 'Nepali'),
('nl', 'Dutch'),
('nn', 'Norwegian Nynorsk'),
('os', 'Ossetic'),
('pa', 'Punjabi'),
('pl', 'Polish'),
('pt', 'Portuguese'),
('pt-br', 'Brazilian Portuguese'),
('ro', 'Romanian'),
('ru', 'Russian'),
('sk', 'Slovak'),
('sl', 'Slovenian'),
('sq', 'Albanian'),
('sr', 'Serbian'),
('sr-latn', 'Serbian Latin'),
('sv', 'Swedish'),
('sw', 'Swahili'),
('ta', 'Tamil'),
('te', 'Telugu'),
('th', 'Thai'),
('tr', 'Turkish'),
('tt', 'Tatar'),
('udm', 'Udmurt'),
('uk', 'Ukrainian'),
('ur', 'Urdu'),
('vi', 'Vietnamese'),
('zh-hans', 'Simplified Chinese'),
('zh-hant', 'Traditional Chinese')]
LANGUAGES_BIDI: ['he', 'ar', 'fa', 'ur']
LANGUAGE_CODE: 'en-us'
LANGUAGE_COOKIE_AGE: None
LANGUAGE_COOKIE_DOMAIN: None
LANGUAGE_COOKIE_NAME: 'django_language'
LANGUAGE_COOKIE_PATH: '/'
LICENSES_SCRAPER: False
LOCALE_PATHS: []
LOGGING_CONFIG: 'logging.config.dictConfig'
LOGIN_REDIRECT_URL: '/'
LOGIN_URL: '/accounts/login/'
LOGOUT_REDIRECT_URL: None
MANAGERS: []
MAX_CAL_TASKS: 500
MAX_COMMENT_ATTACHMENTS: 10
MEDIA_ROOT: '/media/'
MEDIA_URL: '/media/'
MESSAGE_STORAGE: 'django.contrib.messages.storage.fallback.FallbackStorage'
MESSAGE_TAGS: {
10: 'alert-info',
20: 'alert-info',
25: 'alert-success',
30: 'alert-warning',
40: 'alert-danger'}
MIDDLEWARE: None
MIDDLEWARE_CLASSES:
('corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'settings.middleware.TimezoneMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'stronghold.middleware.LoginRequiredMiddleware')
MIGRATION_MODULES: {
}
MONTH_DAY_FORMAT: 'F j'
NUMBER_GROUPING: 0
PASSWORD_HASHERS: '********'
PASSWORD_RESET_TIMEOUT_DAYS: '********'
PHONENUMBER_DEFAULT_FORMAT: 'NATIONAL'
PHONENUMBER_DEFAULT_REGION: 'US'
PREPEND_WWW: False
REPORT_WIDGET_LIST_NUM: 10
REST_FRAMEWORK: {
'DATETIME_INPUT_FORMATS': [ '%Y-%m-%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M',
'%Y-%m-%d',
'%m/%d/%Y %H:%M:%S',
'%m/%d/%Y %H:%M:%S.%f',
'%m/%d/%Y %H:%M',
'%m/%d/%Y',
'%m/%d/%y %H:%M:%S',
'%m/%d/%y %H:%M:%S.%f',
'%m/%d/%y %H:%M',
'%m/%d/%y',
'iso-8601'],
'DATE_INPUT_FORMATS': [ '%Y-%m-%d',
'%m/%d/%Y',
'%m/%d/%y',
'%b %d %Y',
'%b %d, %Y',
'%d %b %Y',
'%d %b, %Y',
'%B %d %Y',
'%B %d, %Y',
'%d %B %Y',
'%d %B, %Y',
'iso-8601'],
'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication'),
'DEFAULT_FILTER_BACKENDS': ( 'django_filters.rest_framework.DjangoFilterBackend',),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning'}
ROLE_ENABLED_MODELS: [{'app_label': 'licenses', 'model': 'lead'},
{'app_label': 'application',
'model': 'application'}]
ROOT_URLCONF: 'cbleads.urls'
SECURE_BROWSER_XSS_FILTER: False
SECURE_CONTENT_TYPE_NOSNIFF: False
SECURE_HSTS_INCLUDE_SUBDOMAINS: False
SECURE_HSTS_PRELOAD: False
SECURE_HSTS_SECONDS: 0
SECURE_PROXY_SSL_HEADER:
('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_REDIRECT_EXEMPT: []
SECURE_SSL_HOST: None
SECURE_SSL_REDIRECT: False
SELECT2_CACHE_BACKEND: 'default'
SELECT2_CACHE_PREFIX: 'select2_'
SELECT2_CSS: '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css'
SELECT2_I18N_AVAILABLE_LANGUAGES: ['ar',
'az',
'bg',
'ca',
'cs',
'da',
'de',
'el',
'en',
'es',
'et',
'eu',
'fa',
'fi',
'fr',
'gl',
'he',
'hi',
'hr',
'hu',
'id',
'is',
'it',
'ja',
'km',
'ko',
'lt',
'lv',
'mk',
'ms',
'nb',
'nl',
'pl',
'pt-BR',
'pt',
'ro',
'ru',
'sk',
'sr-Cyrl',
'sr',
'sv',
'th',
'tr',
'uk',
'vi',
'zh-CN',
'zh-TW']
SELECT2_I18N_PATH: '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/i18n'
SELECT2_JS: 'select2/dist/js/select2.min.js'
SELECT2_LIB_VERSION: '4.0.5'
SERVER_EMAIL: 'admin@mg.surefyre.co'
SESSION_CACHE_ALIAS: 'default'
SESSION_COOKIE_AGE: 1209600
SESSION_COOKIE_DOMAIN: None
SESSION_COOKIE_HTTPONLY: True
SESSION_COOKIE_NAME: 'sessionid'
SESSION_COOKIE_PATH: '/'
SESSION_COOKIE_SECURE: False
SESSION_ENGINE: 'django.contrib.sessions.backends.cached_db'
SESSION_EXPIRE_AT_BROWSER_CLOSE: False
SESSION_FILE_PATH: None
SESSION_SAVE_EVERY_REQUEST: False
SESSION_SERIALIZER: 'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE: 'cbleads.settings'
SF_GROUP_EXTERNAL_NAME: 'external'
SHORT_DATETIME_FORMAT: 'm/d/Y P'
SHORT_DATE_FORMAT: 'm/d/Y'
SIGNING_BACKEND: 'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS: []
SITE_ID: 1
STATICFILES_FINDERS:
('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder')
TEMPLATES: [{'APP_DIRS': True,
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['/code/templates',
'/code/js/pages/dist/templates'],
'NAME': 'django',
'OPTIONS': {'context_processors': ['django.template.context_processors.request',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.debug',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'settings.context_processors.settings']}},
{'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': ['/home/temp/'],
'NAME': 'jinja2'}]
TEST_NON_SERIALIZED_APPS: []
TEST_RUNNER: 'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR: ','
TIME_FORMAT: 'P'
TIME_INPUT_FORMATS: ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']
TIME_ZONE: 'America/Los_Angeles'
USE_ETAGS: False
USE_I18N: False
USE_L10N: True
USE_RDS: True
USE_THOUSAND_SEPARATOR: False
USE_TZ: True
USE_X_FORWARDED_HOST: False
USE_X_FORWARDED_PORT: False
VENV_ACTIVATE: '/code/.venv/bin/activate_this.py'
WSGI_APPLICATION: 'cbleads.wsgi.application'
X_FRAME_OPTIONS: 'SAMEORIGIN'
YEAR_MONTH_FORMAT: 'F Y'
is_overridden: <bound method Settings.is_overridden of <Settings "cbleads.settings">>

Steps to Reproduce

Set a celery beat task via Django settings

Required Dependencies

Minimal Python Version: 3.7

Minimal Celery Version: 4.3

Minimal Kombu 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

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

amqp==2.5.1
appdirs==1.4.3
asn1crypto==0.24.0
attrs==19.1.0
awscli==1.16.169
Babel==2.7.0
backports.csv==1.0.7
beautifulsoup4==4.7.1
billiard==3.6.1.0
boto3==1.9.164
botocore==1.12.159
bs4==0.0.1
cached-property==1.5.1
celery==4.3.0
certifi==2019.6.16
cffi==1.12.3
colorama==0.3.9
coreapi==2.3.3
coreschema==0.0.4
cryptography==2.7
defusedxml==0.6.0
diff-match-patch==20181111
Django==1.11.20
django-activity-stream==0.6.5
django-admin-sortable2==0.6.9
django-annoying==0.10.3
django-anymail==6.1.0
django-appconf==1.0.3
django-attachments==1.4
django-bootstrap-form==3.2.1
django-bootstrap-themes==3.3.6
django-compat==1.0.15
django-compressor==2.2
django-contrib-comments==1.8.0
django-cors-headers==3.1.0
django-crispy-forms==1.6.1
django-dbsettings==0.11.0
django-debug-toolbar==2.0
django-extensions==1.8.1
django-filter==1.1.0
django-fluent-comments==1.4.3
django-froala-editor==2.7.4
django-fsm==2.6.0
django-grappelli==2.9.1
django-haystack==2.8.0
django-helpdesk==0.2.17
django-hijack==2.1.10
django-ical==1.4
django-import-export==1.0.0
django-inplaceedit==1.4.1
django-inplaceedit-bootstrap==0.2.1
django-inplaceedit-extra-fields==0.7.1
django-markdown-deux==1.0.5
django-model-utils==3.2.0
django-money==0.11.4
django-notifications-hq==1.3
django-phonenumber-field==2.0.0
django-select2==6.3.1
django-sql-explorer==1.0
django-storages==1.6.5
django-stronghold==0.2.8
django-tag-parser==3.1
django-taggit==1.1.0
django-threadedcomments==1.1
djangorestframework==3.9.4
docusign-esign==2.0.1
docutils==0.15.2
drf-haystack==1.8.5
elasticsearch==2.4.1
email-reply-parser==0.5.9
enum34==1.1.6
et-xmlfile==1.0.1
Fabric==1.13.1
fdfgen==0.16.1
gevent==1.5a1
google-api-python-client==1.6.2
graphviz==0.8.2
greenlet==0.4.15
gunicorn==19.9.0
httplib2==0.10.3
icalendar==4.0.1
idna==2.2
importlib-metadata==0.20
ipaddress==1.0.18
isodate==0.6.0
itypes==1.1.0
jdcal==1.4.1
Jinja2==2.7.3
jmespath==0.9.4
jsonfield==2.0.2
jsonpickle==0.9.4
kombu==4.6.4
lxml==4.2.1
markdown2==2.3.3
MarkupSafe==1.1.1
mock==3.0.5
more-itertools==7.2.0
nose==1.3.7
oauth2client==4.0.1
oauthlib==3.1.0
odfpy==1.4.0
openpyxl==2.6.3
packaging==16.8
paramiko==2.1.2
pdfkit==0.6.1
phonenumberslite==8.10.17
psycopg2==2.8.2
py-moneyed==0.8.0
pyasn1==0.2.2
pyasn1-modules==0.0.8
pycparser==2.17
Pygments==2.4.2
PyJWT==1.7.1
pyparsing==2.1.10
pypdftk==0.4
python-akismet==0.4.1
python-dateutil==2.8.0
python-memcached==1.59
pytz==2016.10
PyYAML==3.13
rcssmin==1.0.6
redis==2.10.5
requests==2.13.0
requests-aws4auth==0.9
requests-oauthlib==1.2.0
requests-toolbelt==0.9.1
rjsmin==1.0.12
rsa==3.4.2
s3transfer==0.2.1
setproctitle==1.1.10
simplejson==3.10.0
six==1.10.0
soupsieve==1.9.3
sqlparse==0.2.2
tablib==0.13.0
unicodecsv==0.14.1
uritemplate==3.0.0
urllib3==1.20
vine==1.3.0
xlrd==1.2.0
xlwt==1.3.0
zeep==3.4.0
zipp==0.6.0

Other Dependencies

N/A

Minimally Reproducible Test Case

There does not need to be anything special about the task, really any task schedule with beat has this issue.

Here is the task I am using as a test case:

@shared_task
def check_mailgun_events():
logger.error("checking mailgun events")
return 0

Expected Behavior

When a celery beat task fires I would expect the task to go to the default queue or if going to an anonymous queue I would expect the queue to get auto-deleted. Essentially, running a periodic task should not leak a message queue.

Actual Behavior

Every time a periodic task runs a new message queue is created, and the task is successfully run. However, the queue never gets deleted. Overtime this leads to a very large memory leak.

When starting completely fresh our list of queues looks reasonable:

root@rabbitmq:/# rabbitmqadmin list queues

| celery | 0 |
| celery@local.celery.pidbox | 0 |
| celeryev.f4a43753-ab21-4d64-a479-17c3d82f2c72 | 0 |

Here is a snippet of the task being successfully kicked off and executed:

[2019-09-12 01:02:29,427: INFO/Beat] Scheduler: Sending due task check_mailgun_events (cal.tasks.check_mailgun_events)
[2019-09-12 01:02:29,433: INFO/MainProcess] Received task: cal.tasks.check_mailgun_events[e003d5b6-2a60-4631-807e-e79b53205a3f]
[2019-09-12 01:02:29,435: ERROR/ForkPoolWorker-2] checking mailgun events
[2019-09-12 01:02:29,454: INFO/ForkPoolWorker-2] Task cal.tasks.check_mailgun_events[e003d5b6-2a60-4631-807e-e79b53205a3f] succeeded in 0.019439149007666856s: 0
[2019-09-12 01:02:59,444: INFO/Beat] Scheduler: Sending due task check_mailgun_events (cal.tasks.check_mailgun_events)
[2019-09-12 01:02:59,450: INFO/MainProcess] Received task: cal.tasks.check_mailgun_events[831a9b09-65e0-4fc0-8c66-8284d09e30f7]
[2019-09-12 01:02:59,451: ERROR/ForkPoolWorker-2] checking mailgun events
[2019-09-12 01:02:59,476: INFO/ForkPoolWorker-2] Task cal.tasks.check_mailgun_events[831a9b09-65e0-4fc0-8c66-8284d09e30f7] succeeded in 0.024475294980220497s: 0

However, the list of queues grows in rabbitmq one queue for each time any beat task is fired:

| celery | 0 |
| celery@local.celery.pidbox | 0 |
| celeryev.f4a43753-ab21-4d64-a479-17c3d82f2c72 | 0 |
| d76df49a368a4c729a29fc06cdde5e86 | 1 |
| da744520f1f54dc39da01e5b523bd286 | 1 |
| da8730c1ecb9496fa62d2d6376f594a2 | 1 |
| dbd507d4919e409186e43a91cb93cc48 | 1 |
| de875d6dff4c4f96979208703214402d | 1 |
| e003d5b62a604631807ee79b53205a3f | 1 |
| eab67dcf64c8448a901971504b0debb1 | 1 |

After some time this list gets very large, since no queue gets deleted.

Issue 2:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

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 version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Environment & Settings

Celery version: 5.1.2 (sun-harmonics)

Steps to Reproduce

Execute celery -A proj inspect -j active

Expected Behavior

Valid JSON string is returned, like:

{"worker-1": [], "worker-2": [], "worker-3": []}

Actual Behavior

Command returns valid JSON in the first line, followed by double newline and some useless summary:

{"worker-1": [], "worker-2": [], "worker-3": []}

3 nodes online.

which makes the overall output an invalid JSON string.