1

尝试使用 celery 和 celery beat 启动我的开发服务器时,突然出现以下错误。有一天这个东西可以工作,第二天就不行了,我没有改变任何可以解释这一点的东西。我使用工头和 Procfile.dev 启动我的服务器,如下所示:

档案:

web: python manage.py runserver
celeryd: python manage.py celeryd -E -B --loglevel=INFO --concurrency=3
worker: python manage.py celerycam

命令:

foreman start -f Procfile.dev

就像我说的,这从来没有给出任何错误。堆栈跟踪如下:

14:18:44 celeryd.1  | [2013-03-01 14:18:44,216: INFO/Beat] Celerybeat: Starting...
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] Process Beat:
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] Traceback (most recent call last):
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/MainProcess] celery@Allards-MacBook-Pro.local has started.
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/billiard/process.py", line 273, in _bootstrap
14:18:44 celeryd.1  | [2013-03-01 14:18:44,225: WARNING/Beat] self.run()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,226: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 472, in run
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] self.service.start(embedded_process=True)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 401, in start
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] humanize_seconds(self.scheduler.max_interval))
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/kombu/utils/__init__.py", line 234, in __get__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,228: WARNING/Beat] value = obj.__dict__[self.__name__] = self.__get(obj)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 439, in scheduler
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] return self.get_scheduler()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 434, in get_scheduler
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] lazy=lazy)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/utils/imports.py", line 51, in instantiate
14:18:44 celeryd.1  | [2013-03-01 14:18:44,230: WARNING/Beat] return symbol_by_name(name)(*args, **kwargs)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,230: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 124, in __init__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] Scheduler.__init__(self, *args, **kwargs)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 158, in __init__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] self.setup_schedule()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 130, in setup_schedule
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] self.install_default_entries(self.schedule)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 216, in schedule
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] if self.schedule_changed():
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 161, in schedule_changed
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] self._last_timestamp = now()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/utils.py", line 65, in now
14:18:44 celeryd.1  | [2013-03-01 14:18:44,233: WARNING/Beat] return timezone.localtime(timezone.now())
14:18:44 celeryd.1  | [2013-03-01 14:18:44,233: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 222, in localtime
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] timezone = get_current_timezone()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 130, in get_current_timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] return getattr(_active, "value", get_default_timezone())
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 112, in get_default_timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] _localtime = pytz.timezone(settings.TIME_ZONE)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,235: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/pytz/__init__.py", line 183, in timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,236: WARNING/Beat] fp.close()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,236: WARNING/Beat] IOError: [Errno 9] Bad file descriptor

我安装的软件包的版本:

Django==1.4.1
celery==3.0.8
pytz==2012c

我曾尝试重新安装 pytz,但这并没有帮助。

任何建议如何解决这个问题?

编辑 1

我已经尝试过 Burhan Khalid 的回答,这确实修复了 IOError,但是抛出了一个新错误。我尝试了两个地方来粘贴 zoneinfo 数据,它们导致了不同的错误,您可以在下面找到:

当像建议的那样粘贴到 usr/share/zoneinfo/ 中时,我得到了这个:

14:20:07 worker.1   | Traceback (most recent call last):
14:20:07 worker.1   |   File "manage.py", line 9, in <module>
14:20:07 worker.1   |     execute_from_command_line(sys.argv)
14:20:07 celeryd.1  | Traceback (most recent call last):
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 celeryd.1  |   File "manage.py", line 9, in <module>
14:20:07 web.1      | Traceback (most recent call last):
14:20:07 worker.1   |     utility.execute()
14:20:07 celeryd.1  |     execute_from_command_line(sys.argv)
14:20:07 web.1      |   File "manage.py", line 9, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 web.1      |     execute_from_command_line(sys.argv)
14:20:07 worker.1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 celeryd.1  |     utility.execute()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 web.1      |     utility.execute()
14:20:07 worker.1   |     app_name = get_commands()[subcommand]
14:20:07 celeryd.1  |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 web.1      |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 worker.1   |     apps = settings.INSTALLED_APPS
14:20:07 celeryd.1  |     app_name = get_commands()[subcommand]
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 web.1      |     app_name = get_commands()[subcommand]
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |     apps = settings.INSTALLED_APPS
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |     apps = settings.INSTALLED_APPS
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     __import__(name)
14:20:07 celeryd.1  |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 worker.1   |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 web.1      |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 worker.1   |     from django.forms.forms import BaseForm
14:20:07 celeryd.1  |     __import__(name)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 web.1      |     __import__(name)
14:20:07 worker.1   |     from django.forms.fields import *
14:20:07 celeryd.1  |     from django.forms.forms import BaseForm
14:20:07 web.1      |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 web.1      |     from django.forms.forms import BaseForm
14:20:07 worker.1   |     from django.core import validators
14:20:07 celeryd.1  |     from django.forms.fields import *
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 web.1      |     from django.forms.fields import *
14:20:07 worker.1   |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 celeryd.1  |     from django.core import validators
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 web.1      |     from django.core import validators
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     __import__(name)
14:20:07 celeryd.1  |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 worker.1   |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 web.1      |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 worker.1   |     ('nl', gettext_noop('Dutch')),
14:20:07 celeryd.1  |     __import__(name)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 celeryd.1  |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 web.1      |     __import__(name)
14:20:07 celeryd.1  |     ('nl', gettext_noop('Dutch')),
14:20:07 web.1      |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 web.1      |     ('nl', gettext_noop('Dutch')),
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 celeryd.1  |     return _trans.gettext_noop(message)
14:20:07 web.1      |     return _trans.gettext_noop(message)
14:20:07 worker.1   |     return _trans.gettext_noop(message)
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 celeryd.1  |     if settings.USE_I18N:
14:20:07 web.1      |     if settings.USE_I18N:
14:20:07 worker.1   |     if settings.USE_I18N:
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 celeryd.1  |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 web.1      |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 worker.1   |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 celeryd.1  | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 web.1      | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 worker.1   | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 worker.1   | process terminated

当粘贴到 ~/.virtualenvs/env_name/lib/python2.7/site-packages/pytz/zoneinfo 中时:

15:31:18 celeryd.1  | [2013-03-01 15:31:18,179: WARNING/Beat] Process Beat:
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] Traceback (most recent call last):
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/billiard/process.py", line 273, in _bootstrap
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] self.run()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 472, in run
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] self.service.start(embedded_process=True)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 401, in start
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] humanize_seconds(self.scheduler.max_interval))
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/kombu/utils/__init__.py", line 234, in __get__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] value = obj.__dict__[self.__name__] = self.__get(obj)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 439, in scheduler
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] return self.get_scheduler()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 434, in get_scheduler
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] lazy=lazy)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/utils/imports.py", line 51, in instantiate
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/MainProcess] celery@Allards-MacBook-Pro.local has started.
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] return symbol_by_name(name)(*args, **kwargs)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 124, in __init__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] Scheduler.__init__(self, *args, **kwargs)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 158, in __init__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] self.setup_schedule()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 130, in setup_schedule
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] self.install_default_entries(self.schedule)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 216, in schedule
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] if self.schedule_changed():
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 161, in schedule_changed
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] self._last_timestamp = now()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/utils.py", line 65, in now
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] return timezone.localtime(timezone.now())
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 222, in localtime
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] timezone = get_current_timezone()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 130, in get_current_timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] return getattr(_active, "value", get_default_timezone())
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 112, in get_default_timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] _localtime = pytz.timezone(settings.TIME_ZONE)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/pytz/__init__.py", line 185, in timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] raise UnknownTimeZoneError(zone)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] UnknownTimeZoneError: 'Europe/Amsterdam'

因此,提供的 zoneinfo 数据似乎不正确/不完整。我从哪里获得正确的数据?

编辑2:

我将 Burhan Khalid 的答案标记为答案,即使对我来说它不起作用。我这样做是因为我确定我做错了什么并且答案是正确的。我如何解决这个问题只是简单地将 zoneinfo 数据从另一台 macbook 复制粘贴到这个。

4

1 回答 1

1

似乎您的zoneinfo数据库已损坏。下载最新更新并将存档扩展为/usr/share/zoneinfo/.

要更新您的数据库,一旦您下载了需要运行的数据zic(区域信息编译器),并且由于您将更新系统区域文件,您需要使用以下命令运行它sudo

tar xvzf tzdata2012j.tar.gz

然后创建这个小脚本:

#!/bin/bash

ZONES="africa
antartica
asia
australasia
europe
northamerica
pacificnew
solar87
solar88
solar89
southamerica"

for i in $ZONES
   do zic $i
done

然后sudo ./the_script.sh从您展开存档的目录中运行它。

于 2013-03-01T13:47:09.010 回答