Skip to content

Extended list for environment variables don't work #12177

Description

@chris-dietz

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:
    1. Create a fluent-bit.yaml file 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: '*'
    2. Run Fluent Bit:
      fluent-bit -c fluent-bit.yaml
    3. Fluent Bit aborts during configuration parsing.

Expected behavior
Either:

  1. The YAML configuration parser should support the documented extended list form for dynamic secret/file loading under env:, OR
  2. 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 on fluent/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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions