Skip to content

Hot reload fails to resolve relative file paths against the main configuration directory #12333

Description

@antonio

Bug Report

Describe the bug

Fluent Bit can load service files relative to the directory containing the main configuration during startup, but hot reload cannot resolve the same paths.

This is reproducible with both Parsers_File parsers.conf and Plugins_File plugins.conf on current master. In both cases, startup succeeds and hot reload fails. Using an absolute path allows the reload to succeed.

The reload request is initially accepted:

{"reload":"done","status":0}

The asynchronous reload then fails. For Parsers_File, the error is:

[error] [config] could not configure service property 'parsers_file'
[error] [reload] reloaded config format is invalid. Reloading is halted

Plugins_File fails in the same way:

[error] [config] could not configure service property 'plugins_file'
[error] [reload] reloaded config format is invalid. Reloading is halted

The running process keeps its previous configuration, but none of the changes from the failed reload are applied.

To Reproduce

Create a temporary configuration directory:

mkdir -p /tmp/fluent-bit-reload

Create /tmp/fluent-bit-reload/parsers.conf:

[PARSER]
    Name   reload_test
    Format json

Create /tmp/fluent-bit-reload/fluent-bit.conf:

[SERVICE]
    Flush        1
    Log_Level    info
    Parsers_File parsers.conf
    HTTP_Server  On
    HTTP_Listen  127.0.0.1
    HTTP_Port    2020
    Hot_Reload   On

[INPUT]
    Name    dummy
    Samples 1

[OUTPUT]
    Name  stdout
    Match *

Start Fluent Bit from your home directory:

cd "$HOME"
/path/to/fluent-bit -c /tmp/fluent-bit-reload/fluent-bit.conf

Trigger hot reload from another terminal:

curl -X POST -d '{}' http://127.0.0.1:2020/api/v2/reload

Initial startup loads parsers.conf relative to fluent-bit.conf. Hot reload fails because it tries to find parsers.conf relative to the process working directory instead.

Changing Parsers_File to /tmp/fluent-bit-reload/parsers.conf allows the reload to succeed.

The failure can also be reproduced by replacing Parsers_File with a relative Plugins_File and providing a valid plugin configuration file beside the main configuration.

Expected behavior

File paths resolved against the main configuration directory during startup should be resolved against the same directory during hot reload.

Your Environment

  • Version used: Fluent Bit v5.1.1, commit 3713988105fffaded9899d2914a42e04ed0e57e7
  • Operating system: macOS 26.6.2, arm64
  • Configuration format: classic
  • Reload mechanism: HTTP API

Additional context

Fluent Bit records the directory containing the main configuration in conf_path during startup. The new configuration context created during hot reload preserves conf_path_file, but not conf_path. Loaders that depend on conf_path therefore cannot resolve relative files unless the process working directory happens to contain them.

The same configuration directory is also consulted when loading stream processor files and some plugin-specific files, so other relative path settings may be affected.

The parser failure has been reported several times. Previous issues were closed after using absolute paths as a workaround or by stale automation.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions