title: Celery status stuck in pending status
body: <p>I found a example for running celery with mongodb as the backend result here <a href="http://skillachie.com/2013/06/15/intro-celery-and-mongodb/" rel="nofollow noreferrer">original code example</a>. In his example he has CELERYBEAT_SCHEDULE with some parameters to run every minute, in my case i just commented out this code. In my case I just want to run the task as soon as it is received. From the worker log I don't even see the task is received and the output for result.status is PENDING. Why is this staying in the pending status and not completing the task. Its a simple addition task so I cant image it would take a long time.</p>
  
  <p>One other thing is I have virtual environment so from what was told to me is I should run celery as such "<strong>celery multi start worker --loglevel=info</strong>"</p>
  
  <p>I am new to celery and this is a little confusing to me. Thanks in advance for any help.</p>
  
  <p><strong>celeryconfig.py file</strong></p>
  
  <pre><code># from celery.schedules import crontab
  
  CELERY_RESULT_BACKEND = "mongodb"
  CELERY_MONGODB_BACKEND_SETTINGS = {
      "host": "127.0.0.1",
      "port": 27017,
      "database": "jobs", 
      "taskmeta_collection": "stock_taskmeta_collection",
  }
  
  # this was part of the original code but i commented out in hopes 
  # it would run the task right away and not delay.
  #
  #used to schedule tasks periodically and passing optional arguments 
  #Can be very useful. Celery does not seem to support scheduled task but only periodic
  # CELERYBEAT_SCHEDULE = {
  #     'every-minute': {
  #         'task': 'tasks.add',
  #         'schedule': crontab(minute='*/1'),
  #         'args': (1,2),
  #     },
  # }
  </code></pre>
  
  <p><strong>tasks.py file</strong></p>
  
  <pre><code>from celery import Celery
  import time 
  
  #Specify mongodb host and datababse to connect to
  BROKER_URL = 'mongodb://localhost:27017/jobs'
  
  celery = Celery('EOD_TASKS',broker=BROKER_URL)
  
  #Loads settings for Backend to store results of jobs 
  celery.config_from_object('celeryconfig')
  
  @celery.task
  def add(x, y):
      time.sleep(5)
      return x + y
  
  
  
  # starting celery
  celery multi start worker --loglevel=info
  celery multi v4.1.0 (latentcall)
  &gt; Starting nodes...
      &gt; worker@lnx-v2: OK
  </code></pre>
  
  <h1>running celery task</h1>
  
  <pre><code>lnx-v2:171&gt; python
  Python 3.4.1 (default, Nov 12 2014, 13:34:48) 
  [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from tasks import add
  &gt;&gt;&gt; result = add.delay(1,1)
  &gt;&gt;&gt; result
  &lt;AsyncResult: 8e6ee263-d8a4-4b17-8d7a-9873b6c98473&gt;
  &gt;&gt;&gt; result.status
  'PENDING'
  </code></pre>
  
  <h1>worker log</h1>
  
  <pre><code>lnx-v2:208&gt; tail -f worker.log
  [2017-10-26 13:41:15,658: INFO/MainProcess] mingle: all alone
  [2017-10-26 13:41:15,683: INFO/MainProcess] worker@lnx-v2 ready.
  [2017-10-26 13:45:50,465: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
  [2017-10-26 13:45:50,487: INFO/MainProcess] mingle: searching for neighbors
  [2017-10-26 13:45:51,522: INFO/MainProcess] mingle: all alone
  [2017-10-26 13:45:51,540: INFO/MainProcess] worker@lnx-v2 ready.
  [2017-10-26 13:47:13,169: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
  [2017-10-26 13:47:13,191: INFO/MainProcess] mingle: searching for neighbors
  [2017-10-26 13:47:14,228: INFO/MainProcess] mingle: all alone
  [2017-10-26 13:47:14,254: INFO/MainProcess] worker@lnx-v2 ready.
  
  
  # Celery process
  lnx-v2:209&gt; ps -ef | grep celery
  15096     1  0 13:47 ?        00:00:00 [celeryd: worker@lnx-v2:MainProcess] -active- (worker --loglevel=info --logfile=worker%I.log --pidfile=worker.pid --hostname=worker@lnx-v2)
  15157 15096  0 13:47 ?        00:00:00 [celeryd: worker@lnx-v2:ForkPoolWorker-1]
  </code></pre>