fluent/fluentd · error · Fluent::ConfigError

<worker> section cannot have <#{elem.name}> directive

Error message

<worker> section cannot have <#{elem.name}> directive

What it means

Error "<worker> section cannot have <#{elem.name}> directive" thrown in fluent/fluentd.

Source

Thrown at lib/fluent/static_config_analysis.rb:88

    def static_worker_analyse(conf)
      available_worker_ids = [*0...@workers]

      ret = []
      supported_directives = %w[source match filter label]
      conf.elements(name: 'worker').each do |config|
        ids = parse_worker_id(config)
        ids.each do |id|
          if available_worker_ids.include?(id)
            available_worker_ids.delete(id)
          else
            raise Fluent::ConfigError, "specified worker_id<#{id}> collisions is detected on <worker> directive. Available worker id(s): #{available_worker_ids}"
          end
        end

        config.elements.each do |elem|
          unless supported_directives.include?(elem.name)
            raise Fluent::ConfigError, "<worker> section cannot have <#{elem.name}> directive"
          end
        end

        nodes = [
          static_label_analyse(config),
          static_filter_and_output_analyse(config),
          static_input_analyse(config),
        ].flatten
        ret << Elem::Worker.new(ids, config, nodes)
      end

      ret
    end

    def parse_worker_id(conf)
      worker_id_str = conf.arg

      if worker_id_str.empty?

View on GitHub (pinned to dd45c6e18d)

When it happens

Trigger: Thrown at lib/fluent/static_config_analysis.rb:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of fluent/fluentd@dd45c6e18d (2026-08-21). Data as JSON: /api/errors/0450edddcab3efed. Report an issue: GitHub.