Unable to start ElastAlert : Only timezones from the pytz library are supported

2.5k views Asked by At

Unable to test rule in elastic, I am running following command in terminal

elastalert-test-rule --config config.yaml example_rules/example_frequency.yaml
  File "/usr/local/bin/elastalert-test-rule", line 11, in <module>
    load_entry_point('elastalert==0.2.4', 'console_scripts', 'elastalert-test-rule')()
  File "/usr/local/lib/python3.6/dist-packages/elastalert-0.2.4-py3.6.egg/elastalert/test_rule.py", line 445, in main
    test_instance.run_rule_test()
  File "/usr/local/lib/python3.6/dist-packages/elastalert-0.2.4-py3.6.egg/elastalert/test_rule.py", line 437, in run_rule_test
    self.run_elastalert(rule_yaml, conf, args)
  File "/usr/local/lib/python3.6/dist-packages/elastalert-0.2.4-py3.6.egg/elastalert/test_rule.py", line 307, in run_elastalert
    client = ElastAlerter(['--debug'])
  File "/usr/local/lib/python3.6/dist-packages/elastalert-0.2.4-py3.6.egg/elastalert/elastalert.py", line 173, in __init__
    if not self.init_rule(rule):
  File "/usr/local/lib/python3.6/dist-packages/elastalert-0.2.4-py3.6.egg/elastalert/elastalert.py", line 1038, in init_rule
    jitter=5)
  File "/usr/local/lib/python3.6/dist-packages/APScheduler-3.6.3-py3.6.egg/apscheduler/schedulers/base.py", line 420, in add_job
    'trigger': self._create_trigger(trigger, trigger_args),
  File "/usr/local/lib/python3.6/dist-packages/APScheduler-3.6.3-py3.6.egg/apscheduler/schedulers/base.py", line 921, in _create_trigger
    return self._create_plugin_instance('trigger', trigger, trigger_args)
  File "/usr/local/lib/python3.6/dist-packages/APScheduler-3.6.3-py3.6.egg/apscheduler/schedulers/base.py", line 906, in _create_plugin_instance
    return plugin_cls(**constructor_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/APScheduler-3.6.3-py3.6.egg/apscheduler/triggers/interval.py", line 38, in __init__
    self.timezone = astimezone(timezone)
  File "/usr/local/lib/python3.6/dist-packages/APScheduler-3.6.3-py3.6.egg/apscheduler/util.py", line 93, in astimezone
    raise TypeError('Only timezones from the pytz library are supported')
TypeError: Only timezones from the pytz library are supported

I have done following steps :

sudo apt-get update -y
sudo apt-get install -y python3-tzlocal

Also, Added 'tzlocal<3.0', to setup.py

But after all this also I am getting the same error.

Please help!

1

There are 1 answers

0
BigO On BEST ANSWER

You may try running setup again : python3 setup.py install