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

filebeat AttributeError: 'list' object has no attribute 'split' #6

Closed mbruzek closed 8 years ago

mbruzek commented 8 years ago

@chuckbutler you may have already fixed this issue, I remember you working on something like this last week. But I just encountered this error in the latest bundles I have so I wanted to create an issue to track the problem.

unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.juju-log server.go:269 elasticsearch:5: Invoking reactive handler: reactive/filebeat.py:24:render_filebeat_template
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40 {"acknowledged":true}Traceback (most recent call last):
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/charm/hooks/elasticsearch-relation-joined", line 19, in <module>
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     main()
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.4/site-packages/charms/reactive/__init__.py", line 73, in main
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     bus.dispatch()
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 421, in dispatch
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     _invoke(other_handlers)
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 404, in _invoke
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     handler.invoke()
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/.venv/lib/python3.4/site-packages/charms/reactive/bus.py", line 280, in invoke
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     self._action(*args)
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "/var/lib/juju/agents/unit-filebeat-0/charm/reactive/filebeat.py", line 27, in render_filebeat_template
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     render_without_context('filebeat.yml', '/etc/filebeat/filebeat.yml')
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40   File "lib/elasticbeats.py", line 29, in render_without_context
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40     context['logpath'] = context['logpath'].split(' ')
unit-filebeat-0: 2016-05-02 14:41:27 INFO unit.filebeat/0.elasticsearch-relation-joined logger.go:40 AttributeError: 'list' object has no attribute 'split'
unit-filebeat-0: 2016-05-02 14:41:27 ERROR juju.worker.uniter.operation runhook.go:107 hook "elasticsearch-relation-joined" failed: exit status 1

If you have fixed this problem, please link me the PR, and I will review it, if it is already in please let me know what version of the charm it is in.

lazypower commented 8 years ago

Sorry @mbruzek i had this fixed locally but had not pushed the patch up yet. Which explains why i had not seen this failure in a bit :)

Thanks for reporting this bug! I think the above branch fixes the problem. Would you mind terribly taking a look?