{"record":{"id":"6662263a2da3a385","repo":"fluent/fluentd","slug":"other-type-using-this-path-plugin-already-use-666226","errorCode":null,"errorMessage":"Other '#{type_using_this_path}' plugin already uses same buffer path: type = #{type_of_owner}, buffer path = #{@path}","messagePattern":"Other '#(.+?)' plugin already uses same buffer path: type = #(.+?), buffer path = #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"critical","filePath":"lib/fluent/plugin/buf_file_single.rb","lineNumber":123,"sourceCode":"          @multi_workers_available = true\n        else # specified path is file path\n          if File.basename(@path).include?('.*.')\n            new_path = File.join(File.dirname(@path), \"fsb.*#{PATH_SUFFIX}\")\n            log.warn \"file_single doesn't allow user specified 'prefix.*.suffix' style path. Use '#{new_path}' for file instead: #{@path}\"\n            @path = new_path\n          elsif File.basename(@path).end_with?('.*')\n            @path = @path + PATH_SUFFIX\n          else\n            # existing file will be ignored\n            @path = @path + \".*#{PATH_SUFFIX}\"\n          end\n          @multi_workers_available = false\n        end\n\n        type_of_owner = Plugin.lookup_type_from_class(@_owner.class)\n        if @variable_store.has_key?(@path) && !called_in_test?\n          type_using_this_path = @variable_store[@path]\n          raise Fluent::ConfigError, \"Other '#{type_using_this_path}' plugin already uses same buffer path: type = #{type_of_owner}, buffer path = #{@path}\"\n        end\n\n        @variable_store[@path] = type_of_owner\n        @dir_permission = if @dir_permission\n                            @dir_permission.to_i(8)\n                          else\n                            system_config.dir_permission || Fluent::DEFAULT_DIR_PERMISSION\n                          end\n      end\n\n      # This method is called only when multi worker is configured\n      def multi_workers_ready?\n        unless @multi_workers_available\n          log.error \"file_single buffer with multi workers should be configured to use directory 'path', or system root_dir and plugin id\"\n        end\n        @multi_workers_available\n      end\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/buf_file_single.rb#L105-L141","documentation":"Fluentd keeps a per-process VariableStore registry (keyed by :buf_file_single) that maps each resolved buffer path to the plugin type that first claimed it. When a second output plugin's file_single buffer resolves to exactly the same path glob, configure raises Fluent::ConfigError to prevent two plugins from overwriting each other's chunk files. The check is skipped when called_in_test?.","triggerScenarios":"Two <match> or <label> blocks whose file_single buffers resolve to the same path string, e.g. both specify path /var/log/fluent/buffer, or both use the same default path derived from root_dir because they share the same misconfigured @id; also happens when the first plugin was not stopped (variable_store entry not deleted in #stop) before a reload/re-dry-run in the same process.","commonSituations":"Copy-pasting an output block and forgetting to change the buffer path; using the same @id for two plugins; running fluentd --dry-run twice in-process in test harnesses without called_in_test? being true; supervisor hot-reload scenarios where stop hooks did not run.","solutions":["Give each output plugin a distinct buffer path (e.g. append the tag or plugin name: path /var/log/fluent/buffer/out_fwd1)","Alternatively give each plugin a unique @id and rely on root_dir so paths become per-plugin automatically","Restart the fluentd process (not just reload) so the VariableStore is reset when a stale entry is suspected","Check the error text: it names the plugin type that already owns the path — find that plugin in your config and differentiate its path"],"exampleFix":"# before\n<match a.**>\n  @type forward\n  <buffer> @type file_single path /var/log/fluent/buffer </buffer>\n</match>\n<match b.**>\n  @type forward\n  <buffer> @type file_single path /var/log/fluent/buffer </buffer>\n</match>\n\n# after\n<match a.**>\n  @type forward\n  <buffer> @type file_single path /var/log/fluent/buffer/a </buffer>\n</match>\n<match b.**>\n  @type forward\n  <buffer> @type file_single path /var/log/fluent/buffer/b </buffer>\n</match>","handlingStrategy":"validation","validationCode":"# Before starting, assert no two file_single buffers share a resolved path\npaths = config.outputs.flat_map { |o| o.buffers.map(&:resolved_path) }\ndupes = paths.group_by(&:itself).select { |_, v| v.size > 1 }.keys\nabort \"duplicate buffer paths: #{dupes.join(', ')}\" unless dupes.empty?\n\n# Or check the running registry:\nstore = Fluent::VariableStore.fetch_or_build(:buf_file_single)\nstore.each { |path, type| puts \"#{type} owns #{path}\" }","typeGuard":null,"tryCatchPattern":"begin\n  agent = Fluent::Agent.new(log).configure(conf)\nrescue Fluent::ConfigError => e\n  if e.message.include?('already uses same buffer path')\n    # e names the owning plugin type and the contested path; make paths unique and retry\n    retry_after_fixing_paths(e.message)\n  else\n    raise\n  end\nend","preventionTips":["Give every output a distinct buffer path (append tag/plugin name)","Prefer @id + root_dir so paths are auto-namespaced per plugin","Never reuse @id values across outputs","Run fluentd --dry-run, which exercises the same VariableStore check"],"tags":["fluentd","buffer","path-conflict","variable-store","configerror"],"backgroundTag":"duplicate-resource-path","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}