canonical / layer-filebeat

Filebeat is a lightweight log shipper. This is the source for the filebeat charm in the Juju charm store.
Other
3 stars 27 forks source link

install errors with older versions of filebeat. #71

Closed mhilton closed 5 years ago

mhilton commented 5 years ago

If the version of filebeat being installed is older than 5.* (I assume) then the install hook errors.

2019-05-24 06:55:27 INFO juju-log Invoking reactive handler: ../.venv/lib/python3.5/site-packages/charmhelpers/core/host.py:715:wrapped_f
2019-05-24 06:55:27 ERROR juju-log Could not load template filebeat-1.yml from /var/lib/juju/agents/unit-filebeat-0/charm/templates.
2019-05-24 06:55:27 ERROR juju-log Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/reactive/__init__.py", line 73, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charmhelpers/core/host.py", line 719, in wrapped_f
    restart_functions)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charmhelpers/core/host.py", line 741, in restart_on_change_helper
    r = lambda_f()
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charmhelpers/core/host.py", line 718, in <lambda>
    (lambda: f(*args, **kwargs)), restart_map, stopstart,
  File "/var/lib/juju/agents/unit-filebeat-0/charm/reactive/filebeat.py", line 74, in render_filebeat_template
    FILEBEAT_CONFIG
  File "lib/elasticbeats.py", line 55, in render_without_context
    render(source, target, context)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/templating/jinja2.py", line 104, in render
    raise e
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/charms/templating/jinja2.py", line 99, in render
    template = template_env.get_template(source)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/jinja2/environment.py", line 830, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/jinja2/environment.py", line 804, in _load_template
    template = self.loader.load(self, name, globals)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.5/site-packages/jinja2/loaders.py", line 187, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: filebeat-1.yml
cmars commented 5 years ago

This just tripped me up, and I think is breaking several of our deployments :(