celery -A proj report in the issue.pip freeze in the issue.master branch of Celery.
Celery version: 4.3.0rc1 (rhubarb)
celery report Output:
software -> celery:4.3.0rc1 (rhubarb) kombu:4.3.0 py:3.5.6
billiard:3.6.0.0 py-amqp:2.4.1
platform -> system:Linux arch:64bit, ELF
kernel version:4.20.12-arch1-1-ARCH imp:CPython
loader -> celery.loaders.app.AppLoader
settings -> transport:amqp results:redis://localhost:6379/0
accept_content: ['json', 'msgpack']
result_backend: 'redis://localhost:6379/0'
broker_url: 'amqp://user:********@localhost:5672/test'
result_serializer: 'msgpack'
pip freeze Output:
amqp==2.4.1
billiard==3.6.0.0
celery==4.3.0rc1
kombu==4.3.0
msgpack==0.6.1
pytz==2018.9
redis==3.2.0
vine==1.2.0
celeryconfig.py
broker_url = 'amqp://user:password@localhost/test'
result_backend = 'redis://localhost:6379/0'
result_serializer = 'msgpack'
accept_content = ['json', 'msgpack']
tasks.py
from celery import Celery
app = Celery('tasks')
app.config_from_object('celeryconfig')
@app.task
def add(x, y):
return x + y
For convenience, here is a docker-compose.yml file
version: '3'
networks:
celery_msgpack:
services:
redis:
image: redis:latest
ports:
- "6379:6379"
networks:
- celery_msgpack
rabbitmq:
image: rabbitmq:latest
environment:
- RABBITMQ_DEFAULT_USER=user
- RABBITMQ_DEFAULT_PASS=password
- RABBITMQ_DEFAULT_VHOST=test
ports:
- "5672:5672"
- "15672:15672"
networks:
- celery_msgpack
Then, you just need to run the task to reproduce the error.
Serializing results with msgpack should still be possible. However, as far as I know, datetime objects are not supported yet. Maybe this date should be represented as a string (isoformat ?).