title: Celery beat not picking up periodic tasks
body: <p>I am trying to get started with celery, but I can't get my task up and running. I have installed <code>django-celery-beat</code> and <code>celery4</code>.</p>
  
  <p>My settings file.</p>
  
  <p>Installed apps (with celery packages)</p>
  
  <pre><code>...
  'django_celery_beat',
  'django_celery_results' 
  </code></pre>
  
  <p>the celery configuration</p>
  
  <pre><code>CELERY_BROKER_URL = 'redis://localhost:6379/0'
  CELERY_RESULT_BACKEND = 'redis://localhost:6379'
  CELERY_ACCEPT_CONTENT = ['json']
  CELERY_TASK_SERIALIZER = 'json'
  CELERY_RESULT_SERIALIZER = 'json'
  </code></pre>
  
  <p>celery.py</p>
  
  <pre><code>from __future__ import absolute_import, unicode_literals
  import os
  from celery import Celery
  
  # set the default Django settings module for the 'celery' program.
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sandbox.settings')
  
  app = Celery('sandbox')
  
  # Using a string here means the worker doesn't have to serialize
  # the configuration object to child processes.
  # - namespace='CELERY' means all celery-related configuration keys
  #   should have a `CELERY_` prefix.
  app.config_from_object('django.conf:settings', namespace='CELERY')
  
  # Load task modules from all registered Django app configs.
  app.autodiscover_tasks()
  
  
  @app.task(bind=True)
  def debug_task(self):
      print('Request: {0!r}'.format(self.request))
  </code></pre>
  
  <p>and my simple task, which i configured to run through the admin panel of django celery beat.</p>
  
  <pre><code>from __future__ import absolute_import, unicode_literals
  from sandbox.celery import app
  
  
  @app.task()
  def try_celery():
      print "Trying out Celery"
  </code></pre>
  
  <p>I am trying to run this task as a periodic task (beat) with cron tab as <code>*/2 * * * *</code></p>
  
  <p>The log I am getting is,</p>
  
  <pre><code>$ celery -A sandbox worker --loglevel=debug
  
  [2017-10-24 14:28:02,999: DEBUG/MainProcess] | Worker: Preparing bootsteps.
  [2017-10-24 14:28:03,001: DEBUG/MainProcess] | Worker: Building graph...
  [2017-10-24 14:28:03,002: DEBUG/MainProcess] | Worker: New boot order: {Beat, Timer, Hub, Pool, Autoscaler, StateDB, Consumer}
  [2017-10-24 14:28:03,017: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
  [2017-10-24 14:28:03,017: DEBUG/MainProcess] | Consumer: Building graph...
  [2017-10-24 14:28:03,038: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Agent, Gossip, Heart, event loop}
  
   -------------- celery@mypc v4.1.0 (latentcall)
  ---- **** ----- 
  --- * ***  * -- Linux-4.9.0-kali3-amd64-x86_64-with-Kali-kali-rolling-kali-rolling 2017-10-24 14:28:03
  -- * - **** --- 
  - ** ---------- [config]
  - ** ---------- .&gt; app:         sandbox:0x7fe519d38610
  - ** ---------- .&gt; transport:   redis://localhost:6379/0
  - ** ---------- .&gt; results:     redis://localhost:6379/
  - *** --- * --- .&gt; concurrency: 2 (prefork)
  -- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker)
  --- ***** ----- 
   -------------- [queues]
                  .&gt; celery           exchange=celery(direct) key=celery
  
  
  [tasks]
    . celery.accumulate
    . celery.backend_cleanup
    . celery.chain
    . celery.chord
    . celery.chord_unlock
    . celery.chunks
    . celery.group
    . celery.map
    . celery.starmap
    . sandbox.applications.cats.try_celery
    . sandbox.celery.debug_task
  
  [2017-10-24 14:28:03,053: DEBUG/MainProcess] | Worker: Starting Hub
  [2017-10-24 14:28:03,053: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:03,053: DEBUG/MainProcess] | Worker: Starting Pool
  [2017-10-24 14:28:03,197: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:03,198: DEBUG/MainProcess] | Worker: Starting Consumer
  [2017-10-24 14:28:03,199: DEBUG/MainProcess] | Consumer: Starting Connection
  [2017-10-24 14:28:03,216: INFO/MainProcess] Connected to redis://localhost:6379/0
  [2017-10-24 14:28:03,217: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:03,217: DEBUG/MainProcess] | Consumer: Starting Events
  [2017-10-24 14:28:03,228: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:03,229: DEBUG/MainProcess] | Consumer: Starting Mingle
  [2017-10-24 14:28:03,229: INFO/MainProcess] mingle: searching for neighbors
  [2017-10-24 14:28:04,255: INFO/MainProcess] mingle: all alone
  [2017-10-24 14:28:04,256: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:04,256: DEBUG/MainProcess] | Consumer: Starting Tasks
  [2017-10-24 14:28:04,273: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:04,274: DEBUG/MainProcess] | Consumer: Starting Control
  [2017-10-24 14:28:04,277: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:04,277: DEBUG/MainProcess] | Consumer: Starting Gossip
  [2017-10-24 14:28:04,281: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:04,282: DEBUG/MainProcess] | Consumer: Starting Heart
  [2017-10-24 14:28:04,284: DEBUG/MainProcess] ^-- substep ok
  [2017-10-24 14:28:04,284: DEBUG/MainProcess] | Consumer: Starting event loop
  [2017-10-24 14:28:04,285: DEBUG/MainProcess] | Worker: Hub.register Pool...
  [2017-10-24 14:28:04,294: WARNING/MainProcess] /home/alexd/.virtualenvs/skate/local/lib/python2.7/site-packages/celery/fixups/django.py:202: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
    warnings.warn('Using settings.DEBUG leads to a memory leak, never '
  [2017-10-24 14:28:04,294: INFO/MainProcess] celery@mypc ready.
  [2017-10-24 14:28:04,295: DEBUG/MainProcess] basic.qos: prefetch_count-&gt;8
  </code></pre>
  
  <p>why my tasks are not working?</p>
  
  <h1>Update</h1>
  
  <p>log of running celery as beat</p>
  
  <pre><code>$ celery -A sandbox beat --loglevel=debug
  celery beat v4.1.0 (latentcall) is starting.
  Stale pidfile exists - Removing it.
  __    -    ... __   -        _
  LocalTime -&gt; 2017-10-24 15:07:20
  Configuration -&gt;
      . broker -&gt; redis://localhost:6379/0
      . loader -&gt; celery.loaders.app.AppLoader
      . scheduler -&gt; celery.beat.PersistentScheduler
      . db -&gt; celerybeat-schedule
      . logfile -&gt; [stderr]@%DEBUG
      . maxinterval -&gt; 5.00 minutes (300s)
  [2017-10-24 15:07:20,216: DEBUG/MainProcess] Setting default socket timeout to 30
  [2017-10-24 15:07:20,217: INFO/MainProcess] beat: Starting...
  [2017-10-24 15:07:20,372: DEBUG/MainProcess] Current schedule:
  
  [2017-10-24 15:07:20,373: DEBUG/MainProcess] beat: Ticking with max interval-&gt;5.00 minutes
  [2017-10-24 15:07:20,373: DEBUG/MainProcess] beat: Waking up in 5.00 minutes.
  [2017-10-24 15:15:43,232: DEBUG/MainProcess] beat: Synchronizing schedule...
  [2017-10-24 15:15:43,245: DEBUG/MainProcess] beat: Waking up in 5.00 minutes.
  </code></pre>
  
  <p><strong>creation of task</strong>
  <a href="https://i.stack.imgur.com/4isWB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4isWB.png" alt="enter image description here"></a>
  this is how the task is created as a periodic task in the admin.</p>
  
  <p><strong>ps. I changed to interval option, may be some problems with my cron tab? anyway still not working.</strong></p>