Django芹菜在启动时击败了pytz错误

时间:2013-03-01 13:33:40

标签: django pytz celerybeat djcelery

出乎意料的是,当我尝试用芹菜和芹菜打败我的开发服务器时出现以下错误。有一天,这件事在第二天工作,但事实并非如此,我没有改变任何可以解释这一点的事情。我使用foreman和Procfile.dev启动服务器,如下所示:

Procfile:

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

就像我说的那样从来没有给出任何错误。 Stacktrace如下:

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 / like时,我得到了这个:

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复制粘贴到这个。

1 个答案:

答案 0 :(得分:1)

似乎您的zoneinfo数据库已损坏。下载latest update并将存档展开到/usr/share/zoneinfo/

要更新数据库,下载数据后需要运行zic(区域信息编译器),并且由于您要更新系统区域文件,因此需要使用{{1}运行它}:

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 运行它。