fluent/fluentd · error · Fluent::ConfigError

Other '#{type_using_this_path}' plugin already use same buff

Error message

Other '#{type_using_this_path}' plugin already use same buffer path: type = #{type_of_owner}, buffer path = #{@path}

What it means

A process-wide Fluent::VariableStore maps each file-buffer path to the plugin type that claimed it; when a second plugin configures the same @path, configure raises this ConfigError naming both the existing type and the new one. The guard prevents two outputs from interleaving chunks in the same files, which would corrupt both. The check is skipped when called_in_test?, so tests will not surface it.

Source

Thrown at lib/fluent/plugin/buf_file.rb:74

        @variable_store = Fluent::VariableStore.fetch_or_build(:buf_file)

        multi_workers_configured = owner.system_config.workers > 1

        using_plugin_root_dir = false
        unless @path
          if root_dir = owner.plugin_root_dir
            @path = File.join(root_dir, 'buffer')
            using_plugin_root_dir = true # plugin_root_dir path contains worker id
          else
            raise Fluent::ConfigError, "buffer path is not configured. specify 'path' in <buffer>"
          end
        end

        type_of_owner = Plugin.lookup_type_from_class(@_owner.class)
        if @variable_store.has_key?(@path) && !called_in_test?
          type_using_this_path = @variable_store[@path]
          raise ConfigError, "Other '#{type_using_this_path}' plugin already use same buffer path: type = #{type_of_owner}, buffer path = #{@path}"
        end

        @buffer_path = @path
        @variable_store[@buffer_path] = type_of_owner

        specified_directory_exists = File.exist?(@path) && File.directory?(@path)
        unexisting_path_for_directory = !File.exist?(@path) && !@path.include?('.*')

        if specified_directory_exists || unexisting_path_for_directory # directory
          if using_plugin_root_dir || !multi_workers_configured
            @path = File.join(@path, "buffer.*#{@path_suffix}")
          else
            @path = File.join(@path, "worker#{fluentd_worker_id}", "buffer.*#{@path_suffix}")
            if fluentd_worker_id == 0
              # worker 0 always checks unflushed buffer chunks to be resumed (might be created while non-multi-worker configuration)
              @additional_resume_path = File.join(File.expand_path("../../", @path), "buffer.*#{@path_suffix}")
            end
          end

View on GitHub (pinned to dd45c6e18d)

Solutions

  1. Give each buffered output a unique path (e.g. include the @id or tag in the path)
  2. Or rely on root_dir + distinct @id per plugin so implicit paths differ automatically
  3. Search the config for duplicated 'path' values inside <buffer> blocks and deduplicate
  4. Remember the duplicate check is bypassed in tests, so validate paths in your config pipeline too

Example fix

# before
<match a.**>
  @type file
  <buffer>
    @type file
    path /var/log/fluent/buffer/out
  </buffer>
</match>
<match b.**>
  @type file
  <buffer>
    @type file
    path /var/log/fluent/buffer/out
  </buffer>
</match>

# after
<match b.**>
  @type file
  <buffer>
    @type file
    path /var/log/fluent/buffer/out_b
  </buffer>
</match>
Defensive patterns

Strategy: validation

Validate before calling

# Lint generated configs for duplicate buffer paths
paths = conf.scan(/path\s+(\S+)/).flatten
dupes = paths.tally.select { |_, n| n > 1 }.keys
abort "duplicate buffer paths: #{dupes.join(', ')}" unless dupes.empty?

Prevention

When it happens

Trigger: Two <match> blocks with the identical <buffer> path (copy-paste configs); two outputs relying on the same root_dir and the same @id; mixing file and file_single buffers on one path in the same process.

Common situations: Duplicating an output stanza for a second tag and forgetting to change the buffer path; templated config generation reusing one path for many outputs; renames that accidentally collide paths.

Related errors


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