fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

Windows - Running Td-agent from command line with --daemon flag

Open bennettfalkenberg opened this issue 7 months ago • 8 comments

Describe the bug

When running td-agent from command line on Windows with the --daemon flag, we are getting the following error:

Traceback (most recent call last):
        7: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/daemon.rb:13:in `<main>'
        6: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:76:in `run_server'
        5: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:76:in `new'
        4: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:32:in `initialize'
        3: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/config_loader.rb:36:in `initialize'
        2: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/config_loader.rb:43:in `reload_config'
        1: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/daemon.rb:13:in `block in <main>'
C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:443:in `serverengine_config': undefined method `out' for nil:NilClass (NoMethodError)

The same run configuration works on Linux systems

To Reproduce

Run td-agent from command line with --daemon flag set to a pidfile. Our exact command:

td-agent --config=C:\opt\td-agent\etc\td-agent\td-agent.conf --log-rotate-age=100 --log-rotate-size=10000000 --daemon=C:\opt\td-agent\td-agent.pidfile

Expected behavior

for fluentd to properly launch with the pidfile specified

Your Environment

- Fluentd version: 1.16.2
- TD Agent version: 4.5.2
- Operating system: Windows 10

Your Configuration

<system>
  log_level trace
  <log>
    rotate_age 14
    rotate_size 1000000000
  </log>
</system>
@include collector.d/*.conf
<match logsource.**>
  @type xxx
  @id xxx
  @log_level info
  <endpoint>
    xxx
  </endpoint>
  slow_flush_log_threshold 10.0
  <buffer>
    @type file
    path C:/opt/td-agent/spool/
    retry_wait 10
    retry_exponential_backoff_base 2
    retry_type exponential_backoff
    retry_max_interval 120
    retry_randomize true
    retry_forever true
    chunk_limit_size 9.5MB
    total_limit_size 64GB
    overflow_action block
    flush_interval 60s
    flush_thread_count 10
  </buffer>
</match>

Your Error Log

Traceback (most recent call last):
        7: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/daemon.rb:13:in `<main>'
        6: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:76:in `run_server'
        5: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:76:in `new'
        4: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/daemon.rb:32:in `initialize'
        3: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/config_loader.rb:36:in `initialize'
        2: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/serverengine-2.3.2/lib/serverengine/config_loader.rb:43:in `reload_config'
        1: from C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/daemon.rb:13:in `block in <main>'
C:/opt/td-agent/lib/ruby/gems/2.7.0/gems/fluentd-1.16.2/lib/fluent/supervisor.rb:443:in `serverengine_config': undefined method `out' for nil:NilClass (NoMethodError)

Additional context

Like said above, the command works on Linux systems just fine, just not on Windows systems for some reason

bennettfalkenberg avatar Dec 01 '23 21:12 bennettfalkenberg