Issue 1:
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.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: 5.0?5

celery report Output:

$ venv/bin/celery -A celery_worker.celery_app worker --loglevel=info
2021-01-25 14:59:57,746 - job - INFO - __init__ - Starting job celery worker in version 1.4.3
2021-01-25 14:59:57,750 - job - INFO - database - Initializing connection to database...
2021-01-25 14:59:57,752 - job - INFO - database - Connected !
2021-01-25 14:59:57,768 - job - DEBUG - __init__ - Registring celery tasks...
2021-01-25 14:59:58,056 - job - DEBUG - __init__ - Registered !
2021-01-25 14:59:58,056 - job - INFO - __init__ - Celery workers started !
[2021-01-25 14:59:58,101: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2021-01-25 14:59:58,104: DEBUG/MainProcess] | Worker: Building graph...
[2021-01-25 14:59:58,105: DEBUG/MainProcess] | Worker: New boot order: {StateDB, Beat, Timer, Hub, Pool, Autoscaler, Consumer}
[2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Building graph...
[2021-01-25 14:59:58,161: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Agent, Events, Mingle, Tasks, Control, Heart, Gossip, event loop}

-------------- celery@hostname v5.0.5 (singularity)
--- ***** -----
-- ******* ---- Linux-3.10.0-514.21.2.el7.x86_64-x86_64-with-redhat-7.3-Maipo 2021-01-25 14:59:58
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: job:0x7fc7ac843d90
- ** ---------- .> transport: amqp://celery:**@localhost:5672//job_celery
- ** ---------- .> results: mongodb://
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery

[tasks]
. app.lib.celery_beat._delete_from_schedule
. app.lib.celery_beat._update_job_schedule
. app.lib.celery_beat.schedule_job

Steps to Reproduce

Required Dependencies

Minimal Python Version: 3.7.4

Minimal Celery Version: 5.0.5

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: RabbitMQ 3.8.0

Minimal Result Backend Version: MongoDb 4.2.0

Minimal OS and/or Kernel Version: Redhat7 3.10.0-514.21.2.el7.x86_64

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

amqp==5.0.3
astroid==2.3.3
attrs==19.3.0
autopep8==1.4.4
Babel==2.7.0
billiard==3.6.3.0
celery==5.0.5
celerybeat-mongo==0.2.0
celerybeatmongo==0.1.2
certifi==2019.9.11
cffi==1.14.0
chardet==3.0.4
Click==7.0
click-didyoumean==0.0.3
click-plugins==1.1.1
click-repl==0.1.6
coverage==4.5.4
cryptography==2.9.2
fernet==1.0.1
fixtures-mongoengine==1.3.1
Flask==1.1.1
Flask-Babel==0.12.2
Flask-Session==0.3.1
Flask-WTF==0.14.2
idna==2.8
importlib-metadata==1.5.0
isodate==0.6.0
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.11.1
jsonschema==3.2.0
kombu==5.0.2
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
marshmallow==3.6.1
mccabe==0.6.1
mongoengine==0.18.2
paho-mqtt==1.4.0
prompt-toolkit==3.0.11
pyaes==1.6.1
pycodestyle==2.5.0
pycparser==2.20
pylint==2.4.2
pymongo==3.9.0
pyrsistent==0.15.7
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.3
requests==2.22.0
semver==2.9.0
six==1.12.0
typed-ast==1.4.1
urllib3==1.25.6
vine==5.0.0
wcwidth==0.2.5
Werkzeug==0.16.0
wrapt==1.11.2
WTForms==2.2.1
zipp==2.1.0

Other Dependencies

Logs for celery beat worker

2021-01-25 16:01:36,438 - job - INFO - __init__ - Starting job beat in version 1.4.3
2021-01-25 16:01:36,442 - job - INFO - database - Initializing connection to database...
2021-01-25 16:01:36,445 - job - INFO - database - Connected !
2021-01-25 16:01:36,460 - job - DEBUG - __init__ - Registring celery beats...
2021-01-25 16:01:36,833 - job - DEBUG - __init__ - Registered !
2021-01-25 16:01:36,833 - job - INFO - __init__ - Celery beats started !
celery beat v5.0.5 (singularity) is starting.
__ - ... __ - _
LocalTime -> 2021-01-25 16:01:36
Configuration ->
. broker -> amqp://celery:**@localhost:5672//job_celery
. loader -> celery.loaders.app.AppLoader
. scheduler -> celerybeatmongo.schedulers.MongoScheduler

. logfile -> [stderr]@%DEBUG
. maxinterval -> 5.00 seconds (5s)
[2021-01-25 16:01:36,894: DEBUG/MainProcess] Setting default socket timeout to 30
[2021-01-25 16:01:36,895: INFO/MainProcess] beat: Starting...
[2021-01-25 16:01:36,895: DEBUG/MainProcess] mongodb_scheduler_db: heron
[2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_connection_alias: job_beat
[2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_url: mongodb://user:password@127.0.0.1:27017
[2021-01-25 16:01:36,896: INFO/MainProcess] backend scheduler using mongodb://user:password@127.0.0.1:27017/app:job_schedules
[2021-01-25 16:01:36,896: DEBUG/MainProcess] beat: Ticking with max interval->5.00 seconds
[2021-01-25 16:01:36,896: DEBUG/MainProcess] Writing entries...

Minimally Reproducible Test Case

Expected Behavior

I would like my scheduled job run at CET time.

Actual Behavior

I have set the conf as :

CELERY_TIMEZONE = 'Europe/Paris'
CELERY_ENABLE_UTC = False

I store my schedule job in mongoDB with celerybeat-mongo and each time a job run for the first time, the value of last_run_at become a datetime field in mongo in UTC and my job never run any more at the CET time.

I have feeling that when getting the data from mongo, the DateTime Fields which keep the value of last_run_at, there is a problem when comparing the tzinfo.

When I look at tzinfo from now(), I get Europe/Paris and from the last_run_at: <bson.tz_util.FixedOffset object at 0x7fefef163590>

But I'm not able to find where is the source of the issue, is it from celerybeat-mongo or from celery ?

Issue 2:
Celery.send_task from base.py is trying to call AMQP.as_task_v2 with the ignore_result argument, which is not available on 5.0.6.

celery/celery/app/base.py

Line 744
in
171ab02

ignore_result=ignore_result,

celery/celery/app/amqp.py

Lines 280 to 287
in
171ab02

def as_task_v2(self, task_id, name, args=None, kwargs=None,

countdown=None, eta=None, group_id=None, group_index=None,

expires=None, retries=0, chord=None,

callbacks=None, errbacks=None, reply_to=None,

time_limit=None, soft_time_limit=None,

create_sent_event=False, root_id=None, parent_id=None,

shadow=None, chain=None, now=None, timezone=None,

origin=None, argsrepr=None, kwargsrepr=None):

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.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version:

celery report Output:

Steps to Reproduce

Required Dependencies

Minimal Python Version: N/A or Unknown

Minimal Celery Version: N/A or Unknown

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:

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

Actual Behavior