fluent/fluentd · critical · Fluent::ConfigError

this plugin '#{self.class}' cannot handle arguments for <buf

Error message

this plugin '#{self.class}' cannot handle arguments for <buffer ...> section

What it means

Raised as Fluent::ConfigError in Fluent::Compat::BufferedOutput#configure. This shim hosts v0.12 Fluent::BufferedOutput plugins, which have a single global queue: for v0-style config the shim auto-appends a <buffer> element with NO chunk keys. config_style is :v1 exactly when the conf already contains an explicit <buffer> section, and if that section declares chunk keys the old plugin cannot partition its queue, so configure aborts.

Source

Thrown at lib/fluent/compat/output.rb:289

          conf.elements << Fluent::Config::Element.new('buffer', '', buf_params, [])
        end

        @includes_record_filter = self.class.ancestors.include?(Fluent::Compat::RecordFilterMixin)

        methods_of_plugin = self.class.instance_methods(false)
        @overrides_emit = methods_of_plugin.include?(:emit)
        # RecordFilter mixin uses its own #format_stream method implementation
        @overrides_format_stream = methods_of_plugin.include?(:format_stream) || @includes_record_filter

        ParserUtils.convert_parser_conf(conf)
        FormatterUtils.convert_formatter_conf(conf)

        super

        if config_style == :v1
          unless @buffer_config.chunk_keys.empty?
            raise Fluent::ConfigError, "this plugin '#{self.class}' cannot handle arguments for <buffer ...> section"
          end
        end

        self.extend BufferedChunkMixin

        if @overrides_emit
          self.singleton_class.module_eval do
            attr_accessor :last_emit_via_buffer
          end
          output_plugin = self
          m = Module.new do
            define_method(:emit) do |key, data, chain|
              # receivers of this method are buffer instances
              output_plugin.last_emit_via_buffer = [key, data]
            end
          end
          @buffer.extend m
        end

View on GitHub (pinned to dd45c6e18d)

Solutions

  1. Remove the chunk-key argument so the section is a bare <buffer> (no argument), which the check permits
  2. Or drop the <buffer> section entirely and use the plugin's v0.12 parameters (buffer_type, flush_interval, retry_limit, buffer_chunk_limit)
  3. Best: upgrade the plugin to a v1-API release or switch to an equivalent v1 output plugin
  4. Validate with fluentd --dry-run before deploying

Example fix

# before (v0.12 BufferedOutput plugin + v1-style section)
<match app.**>
  @type legacy_output
  <buffer my_key>
    @type memory
  </buffer>
</match>

# after
<match app.**>
  @type legacy_output
  <buffer>
    @type memory
  </buffer>
</match>
Defensive patterns

Strategy: validation

Validate before calling

# catch it before deploy:
#   fluentd --dry-run -c /etc/fluent/fluent.conf
# in code, detect the incompatible combination:
legacy_plugin = plugin.class.ancestors.any? { |a| a.name == 'Fluent::Compat::BufferedOutput' }
buffer_args = conf.elements.find { |e| e.name == 'buffer' }&.arg.to_s.strip
abort 'legacy BufferedOutput plugin cannot take <buffer KEY> args' if legacy_plugin && !buffer_args.empty?

Prevention

When it happens

Trigger: A v0.12 BufferedOutput plugin configured v1-style with <buffer my_key>, <buffer tag>, <buffer time,tag> or similar; copying a v1 config template onto an unmigrated third-party output plugin.

Common situations: Running legacy fluent-plugin-* releases (pre-v1 API) with modern v1-style configs; partial config migrations where the buffer section was upgraded but the plugin was not.

Related errors


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