tagomoris / fluent-plugin-secure-forward

Other
140 stars 30 forks source link

unable to run in container with no `ip` or `ifconfig` #38

Closed t0ffel closed 8 years ago

t0ffel commented 8 years ago

I think the issue is similar to https://github.com/tagomoris/fluent-plugin-route/issues/3

Here is the trace:

2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:372:rescue in main_process: unexpected error error="No such file or directory - addr"
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:587:in ``'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:587:in `ifconfig'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:634:in `mac_address'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:242:in `block in timestamp_create'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:232:in `synchronize'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/uuidtools-2.1.5/lib/uuidtools.rb:232:in `timestamp_create'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:35:in `uuid_timestamp'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:70:in `block (2 levels) in configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:39:in `call'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:39:in `block in replace'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:39:in `each'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:39:in `reduce'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:39:in `replace'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:94:in `check_element'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-mixin-config-placeholders-0.3.1/lib/fluent/mixin/config_placeholders.rb:104:in `configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluent-plugin-secure-forward-0.4.1/lib/fluent/plugin/in_secure_forward.rb:95:in `configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/root_agent.rb:154:in `add_source'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/root_agent.rb:95:in `block in configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/root_agent.rb:92:in `each'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/root_agent.rb:92:in `configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/engine.rb:129:in `configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/engine.rb:103:in `run_configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:483:in `run_configure'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:154:in `block in start'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:360:in `call'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:360:in `main_process'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:333:in `block in supervise'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:332:in `fork'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:332:in `supervise'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/supervisor.rb:150:in `start'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/lib/fluent/command/fluentd.rb:173:in `<top (required)>'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:73:in `require'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:73:in `require'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/gems/fluentd-0.12.25/bin/fluentd:5:in `<top (required)>'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/bin/fluentd:23:in `load'
  2016-05-26 21:51:35 +0000 [error]: fluent/supervisor.rb:332:fork: /opt/app-root/src/bin/fluentd:23:in `<main>'
2016-05-26 21:51:35 +0000 [info]: fluent/supervisor.rb:348:supervise: process finished code=256
2016-05-26 21:51:35 +0000 [warn]: fluent/supervisor.rb:351:supervise: process died within 1 second. exit.

The config:

<source>
  @type secure_forward
  shared_key      string
  self_hostname  fqdn
  bind 0.0.0.0
  port 24284
  secure no

  @label @SECUREFWD
</source>

Is this going to fix the issue? https://github.com/sporkmonger/uuidtools/pull/39

is there a known workaround I could use?

tagomoris commented 8 years ago

Yes, just same issue. But this plugin uses config_placeholders mixin just for hostname, not uuid. It can be removed and replaced with something to provide hostname only. I'll do it when i have time. Or pull requests welcome :)

t0ffel commented 8 years ago

@tagomoris I'm probably missing something, but from what I see from https://github.com/tagomoris/fluent-mixin-config-placeholders only replaces if there is a config key hostname and there is no such config key in secure_forward. Can you please advise what would be a proper test for such a placeholder?

tagomoris commented 8 years ago

That mixin replaces ${hostname} string in any configuration parameters.

tagomoris commented 8 years ago

To say correctly, that mixin does:

tagomoris commented 8 years ago

44 should solve this problem.