django celery rabbitmq issue: "WARNING/MainProcess] Received and deleted unknown message. Wrong destination"
Question: My settings.py

    
    
    CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml', 'pickle', 'application/json']
    CELERY_TASK_SERIALIZER = 'json'
    CELERY_RESULT_SERIALIZER = 'json'
    CELERY_RESULT_BACKEND = 'djcelery.backends.cache:CacheBackend'
    

celery.py code

    
    
    from __future__ import absolute_import
    import os
    from celery import Celery
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webapp.settings')
    from django.conf import settings  
    app = Celery('webapp')
    app.config_from_object('django.conf:settings')
    app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
    
    
    @app.task(bind=True)
    def debug_task(self):
        print('Request: {0!r}'.format(self.request))
    

tasks.py code

    
    
    from __future__ import absolute_import
    from celery.utils.log import get_task_logger
    from celery import shared_task
    import datetime
    
    logger = get_task_logger(__name__)
    
    @shared_task
    def sample_code():
        logger.info("Run time:" + str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M")))
        return None
    

**On shell I am importing and running as "sample_code.delay()"**

Full error stack:

    
    
    [2016-02-12 00:28:56,331: WARNING/MainProcess] Received and deleted unknown message. Wrong destination?!?
    
    The full contents of the message body was: body: '\x80\x02}q\x01(U\x07expiresq\x02NU\x03utcq\x03\x88U\x04argsq\x04]q\x05U\x05chordq\x06NU\tcallbacksq\x07NU\x08errbacksq\x08NU\x07tasksetq\tNU\x02idq\nU$f02e662e-4eda-4180-9af4-2c8a1ceb57c4q\x0bU\x07retriesq\x0cK\x00U\x04taskq\rU$app.tasks.sample_codeq\x0eU\ttimelimitq\x0fNN\x86U\x03etaq\x10NU\x06kwargsq\x11}q\x12u.' (232b)
    {content_type:u'application/x-python-serialize' content_encoding:u'binary'
      delivery_info:{'consumer_tag': u'None4', 'redelivered': False, 'routing_key': u'celery', 'delivery_tag': 8, 'exchange': u'celery'} headers={}}
    

Please let me know where I am wrong


Answer: The way it was solved for me is change in command for running celery

It was giving issue for:

    
    
    celery -A <app_path> worker --loglevel=DEBUG
    

But it's running without issue if we use:

    
    
    celery -A <app_path> worker -l info
    

It may be helpful for other if they face same issue.

