elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

rule can not be tested

Open zffocussss opened this issue 6 years ago • 2 comments

/opt/elastalert/rules $ elastalert-test-rule test1.yaml Traceback (most recent call last): File "/usr/bin/elastalert-test-rule", line 11, in load_entry_point('elastalert==0.2.0b2', 'console_scripts', 'elastalert-test-rule')() File "/usr/lib/python2.7/site-packages/elastalert-0.2.0b2-py2.7.egg/elastalert/test_rule.py", line 441, in main test_instance.run_rule_test() File "/usr/lib/python2.7/site-packages/elastalert-0.2.0b2-py2.7.egg/elastalert/test_rule.py", line 408, in run_rule_test conf = load_conf(args, defaults, overwrites) File "/usr/lib/python2.7/site-packages/elastalert-0.2.0b2-py2.7.egg/elastalert/config.py", line 44, in load_conf conf = yaml_loader(filename) File "/usr/lib/python2.7/site-packages/PyStaticConfiguration-0.10.4-py2.7.egg/staticconf/loader.py", line 167, in yaml_loader with open(filename) as fh: TypeError: coercing to Unicode: need string or buffer, NoneType found

zffocussss avatar Jun 26 '19 16:06 zffocussss

To piggy back on this, it doesn't work in the webui either.

` 22:44:12.171Z ERROR elastalert-server: TestController: Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main

    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/elastalert/elastalert/test_rule.py", line 445, in <module>
    main()
  File "/opt/elastalert/elastalert/test_rule.py", line 441, in main

    test_instance.run_rule_test()
  File "/opt/elastalert/elastalert/test_rule.py", line 408, in run_rule_test

    conf = load_conf(args, defaults, overwrites)
  File "elastalert/config.py", line 47, in load_conf

    configure_logging(args, conf)
  File "elastalert/config.py", line 106, in configure_logging

    if args.verbose and args.debug:

AttributeError: 'Namespace' object has no attribute 'verbose'\

`

mbassett avatar Jun 26 '19 22:06 mbassett

I just saw this in the release notes of 3.0.0beta

Note This is a beta pre-release with ElasticSearch 7 support. As such there will be bugs, testing rules for example is currently broken in ElastAlert v0.2.0b2 (Yelp/elastalert#2204 (comment)).

mbassett avatar Jun 26 '19 22:06 mbassett