<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>
<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>
<p dir="auto"><strong>Celery version</strong>: 4.2.0 (windowlicker)</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="software -&gt; celery:4.2.0 (windowlicker) kombu:4.2.1 py:2.7.5
            billiard:3.5.0.3 redis:2.10.6
platform -&gt; system:Linux arch:64bit, ELF imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://localhost:6543/

CELERY_ACCEPT_CONTENT: ['json']
BROKER_CONNECTION_RETRY: False
CELERY_IGNORE_RESULT: True
CELERY_DEFAULT_QUEUE: 'scheduler'
CELERY_TIMEZONE: 'UTC'
BROKER_URL: u'redis://localhost:6543//'
WORKER_MAX_MEMORY_PER_CHILD: 60000
CELERY_DISABLE_RATE_LIMITS: True
CELERYD_MAX_TASKS_PER_CHILD: 5000
BROKER_POOL_LIMIT: 50
CELERY_TASK_SERIALIZER: 'json'
CELERYD_WORKER_LOST_WAIT: 60.0
CELERY_DEFAULT_EXCHANGE: 'scheduler'
CELERY_QUEUES: 
    (&lt;unbound Queue default -&gt; &lt;unbound Exchange default(direct)&gt; -&gt; default&gt;,
 &lt;unbound Queue scheduler -&gt; &lt;unbound Exchange scheduler(direct)&gt; -&gt; scheduler&gt;,
 &lt;unbound Queue volume_monitor -&gt; &lt;unbound Exchange volume_monitor(direct)&gt; -&gt; volume_monitor&gt;)
CELERY_DEFAULT_ROUTING_KEY: u'********'
BROKER_HEARTBEAT: 600
CELERY_RESULT_BACKEND: u'redis://localhost:6543/'
BROKER_CONNECTION_TIMEOUT: 10
CELERY_ROUTES: {
    'xxx.xxx.task.internal.engine.rollback_task': {   'queue': 'default',
                                                         'routing_key': u'********'},
    'xxx.xxx.task.internal.engine.run_task': {   'queue': 'default',
                                                    'routing_key': u'********'}}
CELERY_REDIS_MAX_CONNECTIONS: 50
CELERYD_PREFETCH_MULTIPLIER: 0
BROKER_HEARTBEAT_CHECKRATE: 5.0
"><pre class="notranslate"><code class="notranslate">software -&gt; celery:4.2.0 (windowlicker) kombu:4.2.1 py:2.7.5
            billiard:3.5.0.3 redis:2.10.6
platform -&gt; system:Linux arch:64bit, ELF imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://localhost:6543/

CELERY_ACCEPT_CONTENT: ['json']
BROKER_CONNECTION_RETRY: False
CELERY_IGNORE_RESULT: True
CELERY_DEFAULT_QUEUE: 'scheduler'
CELERY_TIMEZONE: 'UTC'
BROKER_URL: u'redis://localhost:6543//'
WORKER_MAX_MEMORY_PER_CHILD: 60000
CELERY_DISABLE_RATE_LIMITS: True
CELERYD_MAX_TASKS_PER_CHILD: 5000
BROKER_POOL_LIMIT: 50
CELERY_TASK_SERIALIZER: 'json'
CELERYD_WORKER_LOST_WAIT: 60.0
CELERY_DEFAULT_EXCHANGE: 'scheduler'
CELERY_QUEUES: 
    (&lt;unbound Queue default -&gt; &lt;unbound Exchange default(direct)&gt; -&gt; default&gt;,
 &lt;unbound Queue scheduler -&gt; &lt;unbound Exchange scheduler(direct)&gt; -&gt; scheduler&gt;,
 &lt;unbound Queue volume_monitor -&gt; &lt;unbound Exchange volume_monitor(direct)&gt; -&gt; volume_monitor&gt;)
CELERY_DEFAULT_ROUTING_KEY: u'********'
BROKER_HEARTBEAT: 600
CELERY_RESULT_BACKEND: u'redis://localhost:6543/'
BROKER_CONNECTION_TIMEOUT: 10
CELERY_ROUTES: {
    'xxx.xxx.task.internal.engine.rollback_task': {   'queue': 'default',
                                                         'routing_key': u'********'},
    'xxx.xxx.task.internal.engine.run_task': {   'queue': 'default',
                                                    'routing_key': u'********'}}
CELERY_REDIS_MAX_CONNECTIONS: 50
CELERYD_PREFETCH_MULTIPLIER: 0
BROKER_HEARTBEAT_CHECKRATE: 5.0

</code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>
<ul dir="auto">
<li><strong>Minimal Python Version</strong>: 2.7.5</li>
<li><strong>Minimal Celery Version</strong>: 4.2.0 (windowlicker)</li>
<li><strong>Minimal Kombu Version</strong>: 4.2.1</li>
<li><strong>Minimal Broker Version</strong>: redis-2.8.21-1.el7.x86_64  and python-redis-2.10.6-1.noarch</li>
<li><strong>Minimal Result Backend Version</strong>: redis-2.8.21-1.el7.x86_64 and python-redis-2.10.6-1.noarch</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: Linux version 3.10.0-514.44.5.10_136.x86_64</li>
</ul>
<h2 dir="auto">Minimally Reproducible Test Case</h2>
<p dir="auto"><strong>This my reproducible steps :</strong><br>
1.kill the process of celery beat ;</p>
<p dir="auto">2.run cmd '<strong>celery beat --detach -A xxx.xxx.task.internal.engine.app -s /var/run/celerybeat-schedule --max-interval=3 --pidfile=/xxx/xxx/test-beat.pid --logfile=/var/log/xxx/xxx/celery-beat.log --loglevel=DEBUG</strong>';</p>
<p dir="auto">3.check the result of celery beat process and celery-beat.log;</p>
<h1 dir="auto">Expected Behavior</h1>
<p dir="auto">Expected Behavior is celery beat process is running.</p>
<h1 dir="auto">Actual Behavior</h1>
<p dir="auto">Actual Behavior is celery beat can't start.</p>
<details>
<summary><b><code class="notranslate">celery-beat.log</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2019-03-29 09:33:13,302: DEBUG/MainProcess] Setting default socket timeout to 30
[2019-03-29 09:33:13,303: INFO/MainProcess] beat: Starting...
[2019-03-29 09:33:13,318: CRITICAL/MainProcess] beat raised exception &lt;class 'bsddb.db.DBError'&gt;: DBError(9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/site-packages/celery/apps/beat.py&quot;, line 109, in start_scheduler
    service.start()
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 579, in start
    humanize_seconds(self.scheduler.max_interval))
  File &quot;/usr/lib/python2.7/site-packages/kombu/utils/objects.py&quot;, line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 623, in scheduler
    return self.get_scheduler()
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 618, in get_scheduler
    lazy=lazy,
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 458, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 225, in __init__
    self.setup_schedule()
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 508, in setup_schedule
    self.sync()
  File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 544, in sync
    self._store.sync()
  File &quot;/usr/lib64/python2.7/shelve.py&quot;, line 165, in sync
    self[key] = entry
  File &quot;/usr/lib64/python2.7/shelve.py&quot;, line 133, in __setitem__
    self.dict[key] = f.getvalue()
  File &quot;/usr/lib64/python2.7/bsddb/__init__.py&quot;, line 279, in __setitem__
    _DeadlockWrap(wrapF)  # self.db[key] = value
  File &quot;/usr/lib64/python2.7/bsddb/dbutils.py&quot;, line 68, in DeadlockWrap
    return function(*_args, **_kwargs)
  File &quot;/usr/lib64/python2.7/bsddb/__init__.py&quot;, line 278, in wrapF
    self.db[key] = value
DBError: (9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
[2019-03-29 09:33:13,319: WARNING/MainProcess] Traceback (most recent call last):
[2019-03-29 09:33:13,320: WARNING/MainProcess] File &quot;/bin/celery&quot;, line 9, in &lt;module&gt;
[2019-03-29 09:33:13,320: WARNING/MainProcess] load_entry_point('celery==4.2.0', 'console_scripts', 'celery')()
[2019-03-29 09:33:13,320: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/__main__.py&quot;, line 16, in main
[2019-03-29 09:33:13,320: WARNING/MainProcess] _main()
[2019-03-29 09:33:13,320: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/celery.py&quot;, line 322, in main
[2019-03-29 09:33:13,321: WARNING/MainProcess] cmd.execute_from_commandline(argv)
[2019-03-29 09:33:13,321: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/celery.py&quot;, line 496, in execute_from_commandline
[2019-03-29 09:33:13,321: WARNING/MainProcess] super(CeleryCommand, self).execute_from_commandline(argv)))
[2019-03-29 09:33:13,321: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/base.py&quot;, line 275, in execute_from_commandline
[2019-03-29 09:33:13,322: WARNING/MainProcess] return self.handle_argv(self.prog_name, argv[1:])
[2019-03-29 09:33:13,322: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/celery.py&quot;, line 488, in handle_argv
[2019-03-29 09:33:13,322: WARNING/MainProcess] return self.execute(command, argv)
[2019-03-29 09:33:13,322: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/celery.py&quot;, line 420, in execute
[2019-03-29 09:33:13,323: WARNING/MainProcess] ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
[2019-03-29 09:33:13,323: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/base.py&quot;, line 279, in run_from_argv
[2019-03-29 09:33:13,323: WARNING/MainProcess] sys.argv if argv is None else argv, command)
[2019-03-29 09:33:13,323: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/base.py&quot;, line 363, in handle_argv
[2019-03-29 09:33:13,324: WARNING/MainProcess] return self(*args, **options)
[2019-03-29 09:33:13,324: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/base.py&quot;, line 238, in __call__
[2019-03-29 09:33:13,324: WARNING/MainProcess] ret = self.run(*args, **kwargs)
[2019-03-29 09:33:13,324: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/bin/beat.py&quot;, line 107, in run
[2019-03-29 09:33:13,324: WARNING/MainProcess] return beat().run()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/apps/beat.py&quot;, line 81, in run
[2019-03-29 09:33:13,325: WARNING/MainProcess] self.start_scheduler()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/apps/beat.py&quot;, line 109, in start_scheduler
[2019-03-29 09:33:13,325: WARNING/MainProcess] service.start()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 579, in start
[2019-03-29 09:33:13,326: WARNING/MainProcess] humanize_seconds(self.scheduler.max_interval))
[2019-03-29 09:33:13,326: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/kombu/utils/objects.py&quot;, line 44, in __get__
[2019-03-29 09:33:13,326: WARNING/MainProcess] value = obj.__dict__[self.__name__] = self.__get(obj)
[2019-03-29 09:33:13,326: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 623, in scheduler
[2019-03-29 09:33:13,327: WARNING/MainProcess] return self.get_scheduler()
[2019-03-29 09:33:13,327: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 618, in get_scheduler
[2019-03-29 09:33:13,327: WARNING/MainProcess] lazy=lazy,
[2019-03-29 09:33:13,327: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 458, in __init__
[2019-03-29 09:33:13,328: WARNING/MainProcess] Scheduler.__init__(self, *args, **kwargs)
[2019-03-29 09:33:13,328: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 225, in __init__
[2019-03-29 09:33:13,328: WARNING/MainProcess] self.setup_schedule()
[2019-03-29 09:33:13,328: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 508, in setup_schedule
[2019-03-29 09:33:13,329: WARNING/MainProcess] self.sync()
[2019-03-29 09:33:13,329: WARNING/MainProcess] File &quot;/usr/lib/python2.7/site-packages/celery/beat.py&quot;, line 544, in sync
[2019-03-29 09:33:13,329: WARNING/MainProcess] self._store.sync()
[2019-03-29 09:33:13,330: WARNING/MainProcess] File &quot;/usr/lib64/python2.7/shelve.py&quot;, line 165, in sync
[2019-03-29 09:33:13,330: WARNING/MainProcess] self[key] = entry
[2019-03-29 09:33:13,330: WARNING/MainProcess] File &quot;/usr/lib64/python2.7/shelve.py&quot;, line 133, in __setitem__
[2019-03-29 09:33:13,330: WARNING/MainProcess] self.dict[key] = f.getvalue()
[2019-03-29 09:33:13,330: WARNING/MainProcess] File &quot;/usr/lib64/python2.7/bsddb/__init__.py&quot;, line 279, in __setitem__
[2019-03-29 09:33:13,331: WARNING/MainProcess] _DeadlockWrap(wrapF)  # self.db[key] = value
[2019-03-29 09:33:13,331: WARNING/MainProcess] File &quot;/usr/lib64/python2.7/bsddb/dbutils.py&quot;, line 68, in DeadlockWrap
[2019-03-29 09:33:13,331: WARNING/MainProcess] return function(*_args, **_kwargs)
[2019-03-29 09:33:13,331: WARNING/MainProcess] File &quot;/usr/lib64/python2.7/bsddb/__init__.py&quot;, line 278, in wrapF
[2019-03-29 09:33:13,332: WARNING/MainProcess] self.db[key] = value
[2019-03-29 09:33:13,332: WARNING/MainProcess] bsddb.db
[2019-03-29 09:33:13,332: WARNING/MainProcess] .
[2019-03-29 09:33:13,332: WARNING/MainProcess] DBError
[2019-03-29 09:33:13,332: WARNING/MainProcess] :
[2019-03-29 09:33:13,333: WARNING/MainProcess] (9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
[2019-03-29 09:33:13,368: WARNING/MainProcess] Exception
[2019-03-29 09:33:13,368: WARNING/MainProcess] bsddb.db
[2019-03-29 09:33:13,369: WARNING/MainProcess] .
[2019-03-29 09:33:13,369: WARNING/MainProcess] DBError
[2019-03-29 09:33:13,369: WARNING/MainProcess] :
[2019-03-29 09:33:13,369: WARNING/MainProcess] DBError(29, 'Illegal seek -- BDB3027 /var/run/celerybeat-schedule: unable to flush page: 3')
[2019-03-29 09:33:13,369: WARNING/MainProcess] in
"><pre class="notranslate"><code class="notranslate">[2019-03-29 09:33:13,302: DEBUG/MainProcess] Setting default socket timeout to 30
[2019-03-29 09:33:13,303: INFO/MainProcess] beat: Starting...
[2019-03-29 09:33:13,318: CRITICAL/MainProcess] beat raised exception &lt;class 'bsddb.db.DBError'&gt;: DBError(9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/celery/apps/beat.py", line 109, in start_scheduler
    service.start()
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 579, in start
    humanize_seconds(self.scheduler.max_interval))
  File "/usr/lib/python2.7/site-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 623, in scheduler
    return self.get_scheduler()
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 618, in get_scheduler
    lazy=lazy,
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 458, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 225, in __init__
    self.setup_schedule()
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 508, in setup_schedule
    self.sync()
  File "/usr/lib/python2.7/site-packages/celery/beat.py", line 544, in sync
    self._store.sync()
  File "/usr/lib64/python2.7/shelve.py", line 165, in sync
    self[key] = entry
  File "/usr/lib64/python2.7/shelve.py", line 133, in __setitem__
    self.dict[key] = f.getvalue()
  File "/usr/lib64/python2.7/bsddb/__init__.py", line 279, in __setitem__
    _DeadlockWrap(wrapF)  # self.db[key] = value
  File "/usr/lib64/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
    return function(*_args, **_kwargs)
  File "/usr/lib64/python2.7/bsddb/__init__.py", line 278, in wrapF
    self.db[key] = value
DBError: (9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
[2019-03-29 09:33:13,319: WARNING/MainProcess] Traceback (most recent call last):
[2019-03-29 09:33:13,320: WARNING/MainProcess] File "/bin/celery", line 9, in &lt;module&gt;
[2019-03-29 09:33:13,320: WARNING/MainProcess] load_entry_point('celery==4.2.0', 'console_scripts', 'celery')()
[2019-03-29 09:33:13,320: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/__main__.py", line 16, in main
[2019-03-29 09:33:13,320: WARNING/MainProcess] _main()
[2019-03-29 09:33:13,320: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/celery.py", line 322, in main
[2019-03-29 09:33:13,321: WARNING/MainProcess] cmd.execute_from_commandline(argv)
[2019-03-29 09:33:13,321: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/celery.py", line 496, in execute_from_commandline
[2019-03-29 09:33:13,321: WARNING/MainProcess] super(CeleryCommand, self).execute_from_commandline(argv)))
[2019-03-29 09:33:13,321: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 275, in execute_from_commandline
[2019-03-29 09:33:13,322: WARNING/MainProcess] return self.handle_argv(self.prog_name, argv[1:])
[2019-03-29 09:33:13,322: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/celery.py", line 488, in handle_argv
[2019-03-29 09:33:13,322: WARNING/MainProcess] return self.execute(command, argv)
[2019-03-29 09:33:13,322: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/celery.py", line 420, in execute
[2019-03-29 09:33:13,323: WARNING/MainProcess] ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
[2019-03-29 09:33:13,323: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 279, in run_from_argv
[2019-03-29 09:33:13,323: WARNING/MainProcess] sys.argv if argv is None else argv, command)
[2019-03-29 09:33:13,323: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 363, in handle_argv
[2019-03-29 09:33:13,324: WARNING/MainProcess] return self(*args, **options)
[2019-03-29 09:33:13,324: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/base.py", line 238, in __call__
[2019-03-29 09:33:13,324: WARNING/MainProcess] ret = self.run(*args, **kwargs)
[2019-03-29 09:33:13,324: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/bin/beat.py", line 107, in run
[2019-03-29 09:33:13,324: WARNING/MainProcess] return beat().run()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/apps/beat.py", line 81, in run
[2019-03-29 09:33:13,325: WARNING/MainProcess] self.start_scheduler()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/apps/beat.py", line 109, in start_scheduler
[2019-03-29 09:33:13,325: WARNING/MainProcess] service.start()
[2019-03-29 09:33:13,325: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 579, in start
[2019-03-29 09:33:13,326: WARNING/MainProcess] humanize_seconds(self.scheduler.max_interval))
[2019-03-29 09:33:13,326: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/kombu/utils/objects.py", line 44, in __get__
[2019-03-29 09:33:13,326: WARNING/MainProcess] value = obj.__dict__[self.__name__] = self.__get(obj)
[2019-03-29 09:33:13,326: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 623, in scheduler
[2019-03-29 09:33:13,327: WARNING/MainProcess] return self.get_scheduler()
[2019-03-29 09:33:13,327: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 618, in get_scheduler
[2019-03-29 09:33:13,327: WARNING/MainProcess] lazy=lazy,
[2019-03-29 09:33:13,327: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 458, in __init__
[2019-03-29 09:33:13,328: WARNING/MainProcess] Scheduler.__init__(self, *args, **kwargs)
[2019-03-29 09:33:13,328: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 225, in __init__
[2019-03-29 09:33:13,328: WARNING/MainProcess] self.setup_schedule()
[2019-03-29 09:33:13,328: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 508, in setup_schedule
[2019-03-29 09:33:13,329: WARNING/MainProcess] self.sync()
[2019-03-29 09:33:13,329: WARNING/MainProcess] File "/usr/lib/python2.7/site-packages/celery/beat.py", line 544, in sync
[2019-03-29 09:33:13,329: WARNING/MainProcess] self._store.sync()
[2019-03-29 09:33:13,330: WARNING/MainProcess] File "/usr/lib64/python2.7/shelve.py", line 165, in sync
[2019-03-29 09:33:13,330: WARNING/MainProcess] self[key] = entry
[2019-03-29 09:33:13,330: WARNING/MainProcess] File "/usr/lib64/python2.7/shelve.py", line 133, in __setitem__
[2019-03-29 09:33:13,330: WARNING/MainProcess] self.dict[key] = f.getvalue()
[2019-03-29 09:33:13,330: WARNING/MainProcess] File "/usr/lib64/python2.7/bsddb/__init__.py", line 279, in __setitem__
[2019-03-29 09:33:13,331: WARNING/MainProcess] _DeadlockWrap(wrapF)  # self.db[key] = value
[2019-03-29 09:33:13,331: WARNING/MainProcess] File "/usr/lib64/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
[2019-03-29 09:33:13,331: WARNING/MainProcess] return function(*_args, **_kwargs)
[2019-03-29 09:33:13,331: WARNING/MainProcess] File "/usr/lib64/python2.7/bsddb/__init__.py", line 278, in wrapF
[2019-03-29 09:33:13,332: WARNING/MainProcess] self.db[key] = value
[2019-03-29 09:33:13,332: WARNING/MainProcess] bsddb.db
[2019-03-29 09:33:13,332: WARNING/MainProcess] .
[2019-03-29 09:33:13,332: WARNING/MainProcess] DBError
[2019-03-29 09:33:13,332: WARNING/MainProcess] :
[2019-03-29 09:33:13,333: WARNING/MainProcess] (9, 'Bad file descriptor -- BDB0142 ftruncate: 16384: Bad file descriptor')
[2019-03-29 09:33:13,368: WARNING/MainProcess] Exception
[2019-03-29 09:33:13,368: WARNING/MainProcess] bsddb.db
[2019-03-29 09:33:13,369: WARNING/MainProcess] .
[2019-03-29 09:33:13,369: WARNING/MainProcess] DBError
[2019-03-29 09:33:13,369: WARNING/MainProcess] :
[2019-03-29 09:33:13,369: WARNING/MainProcess] DBError(29, 'Illegal seek -- BDB3027 /var/run/celerybeat-schedule: unable to flush page: 3')
[2019-03-29 09:33:13,369: WARNING/MainProcess] in

</code></pre></div>
<p dir="auto"></p>
</details>
<p dir="auto"><strong>Extra try</strong></p>
<p dir="auto">But after I commented the following two lines of code in my parameter -A: xxx.xxx.task.internal.engine.py</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import celery.concurrency.prefork as celery_prefork
celery_prefork.process_destructor = process_destructor
app = Celery('tasks', backend='redis://localhost:6543', broker='redis://localhost:6543//')
app.conf.update(
    CELERY_DEFAULT_QUEUE='xxx',
   xxx
)
"><pre class="notranslate"><code class="notranslate">import celery.concurrency.prefork as celery_prefork
celery_prefork.process_destructor = process_destructor
app = Celery('tasks', backend='redis://localhost:6543', broker='redis://localhost:6543//')
app.conf.update(
    CELERY_DEFAULT_QUEUE='xxx',
   xxx
)

</code></pre></div>
<p dir="auto">and try to start celery beat , the celery beat start successfully.<br>
But I want keep two lines of code in -A proj to custom "celery.concurrency.prefork".<br>
I don't know why.<br>
And if  I come back to  the <code class="notranslate">4.1.0</code> branch of Celery, the problem does not appear.</p>
<p dir="auto">As a new celery user I cannot discern if celeryd should be ran with with both /etc/default/celeryd config AND Django settings.py, or one or the other?  If just Django settings.py, how does the /etc/init.d/celeryd script know that it is there?  If both, why are there duplicate settings?   Or maybe /etc/default/celeryd isn't needed with django as the project claims it can pull everything from Django settings?</p>
<p dir="auto">None of the above questions are answered in the documentation.  The documentation just sort of lays out options to try and I have to do each one experimentally and see if the result works or not.</p>