Extended list for environment variables don't work
Bug Report
Describe the bug
The official documentation for YAML Environment Variables documents an "Extended list form" for the env section (using - name: ..., uri: ..., refresh_interval: ...).
However, using this documented syntax causes Fluent Bit to fail on startup with a YAML parse error:
unexpected event 'sequence-start-event' (7) in state 'env' (41).
The YAML parser (flb_cf_yaml.c) state machine for STATE_ENV strictly expects a mapping (YAML_MAPPING_START_EVENT) and rejects sequences (YAML_SEQUENCE_START_EVENT), making the documented extended list syntax completely unusable.
To Reproduce
- Example log message:
[error] [config] YAML error found in file "/fluent-bit/etc/fluent-bit.yaml", line 2, column 2: unexpected event 'sequence-start-event' (7) in state 'env' (41).
[error] yaml error
[error] configuration file contains errors, aborting.- Steps to reproduce the problem:
- Create a
fluent-bit.yamlfile with the exact example from the documentation:env: - name: DB_PASSWORD uri: file:///run/secrets/db_password refresh_interval: 60 - name: REGION value: us-east-1 service: flush: 1 log_level: info pipeline: inputs: - name: dummy outputs: - name: stdout match: '*' - Run Fluent Bit:
fluent-bit -c fluent-bit.yaml - Fluent Bit aborts during configuration parsing.
- Create a
Expected behavior Either:
- The YAML configuration parser should support the documented extended list form for dynamic secret/file loading under
env:, OR - The documentation should be updated/corrected to state that only the map form (
env: KEY: value) is supported, removing the invalid extended list examples.
Your Environment
- Version used:
4.2.7(reproduced onfluent/fluent-bit:4.2.7-debug) - Configuration: Minimal YAML configuration containing the documented
env:list syntax - Environment name and version: Docker / Container
- Operating System and version: Linux
Additional context Documented at: https://docs.fluentbit.io/manual/4.2/administration/configuring-fluent-bit/yaml/environment-variables-section#extended-list-form
Source: fluent/fluent-bit