{"record":{"id":"ce5fef8af2bacb95","repo":"fluent/fluentd","slug":"buffer-section-is-configured-but-plugin-self","errorCode":null,"errorMessage":"<buffer> section is configured, but plugin '#{self.class}' doesn't support buffering","messagePattern":"<buffer> section is configured, but plugin '#(.+?)' doesn't support buffering","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":270,"sourceCode":"        has_buffer_section = (conf.elements(name: 'buffer').size > 0)\n        has_flush_interval = conf.has_key?('flush_interval')\n\n        super\n\n        @num_errors_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"num_errors\", help_text: \"Number of count num errors\")\n        @emit_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"emit_count\", help_text: \"Number of count emits\")\n        @emit_records_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"emit_records\", help_text: \"Number of emit records\")\n        @emit_size_metrics =  metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"emit_size\", help_text: \"Total size of emit events\")\n        @write_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"write_count\", help_text: \"Number of writing events\")\n        @write_secondary_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"write_secondary_count\", help_text: \"Number of writing events in secondary\")\n        @rollback_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"rollback_count\", help_text: \"Number of rollbacking operations\")\n        @flush_time_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"flush_time_count\", help_text: \"Count of flush time\")\n        @slow_flush_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"slow_flush_count\", help_text: \"Count of slow flush occurred time(s)\")\n        @drop_oldest_chunk_count_metrics = metrics_create(namespace: \"fluentd\", subsystem: \"output\", name: \"drop_oldest_chunk_count\", help_text: \"Number of count that old chunk were discarded with drop_oldest_chunk\")\n\n        if has_buffer_section\n          unless implement?(:buffered) || implement?(:delayed_commit)\n            raise Fluent::ConfigError, \"<buffer> section is configured, but plugin '#{self.class}' doesn't support buffering\"\n          end\n          @buffering = true\n        else # no buffer sections\n          if implement?(:synchronous)\n            if !implement?(:buffered) && !implement?(:delayed_commit)\n              if @as_secondary\n                raise Fluent::ConfigError, \"secondary plugin '#{self.class}' must support buffering, but doesn't.\"\n              end\n              @buffering = false\n            else\n              if @as_secondary\n                # secondary plugin always works as buffered plugin without buffer instance\n                @buffering = true\n              else\n                # @buffering.nil? shows that enabling buffering or not will be decided in lazy way in #start\n                @buffering = nil\n              end\n            end","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L252-L288","documentation":"Fluent::Plugin::Output#configure raises this Fluent::ConfigError when the config contains a `<buffer>` section for an output plugin that implements neither `buffered` (a #write method) nor `delayed_commit` (#try_write) processing — only synchronous #process. Buffering capability is determined by which processing methods the plugin class defines, so a `<buffer>` block on a process-only plugin is meaningless and rejected at startup.","triggerScenarios":"Adding `<buffer> ... </buffer>` to a synchronous-only output — stock examples: out_copy, out_relabel-style routers, most custom plugins that define only `process`. Configure fails before any data is processed.","commonSituations":"Users adding buffer/flush tuning to `<match> @type copy` hoping to smooth bursts; plugin authors forgetting to define #write; configs migrated from v0.12 buffered_* compat plugins.","solutions":["Remove the <buffer> section — the plugin (e.g. out_copy) forwards events synchronously by design","If you need buffering, wrap the target in a buffering-capable output (e.g. route to @type forward/file/http which implement #write) and put the sync plugin behind it","Plugin authors: define #write(chunk) (buffered) or #try_write(chunk) + #commit_write (delayed commit) to accept <buffer>"],"exampleFix":"# before\n<match **>\n  @type copy\n  <store> @type stdout </store>\n  <buffer>            # out_copy supports only synchronous processing\n    flush_interval 1s\n  </buffer>\n</match>\n\n# after\n<match **>\n  @type copy\n  <store> @type stdout </store>\n</match>\n# (buffer the buffered-capable stores individually if needed)","handlingStrategy":"type-guard","validationCode":"# For plugin authors / test rigs: probe capabilities before accepting a <buffer> section\nplugin = Fluent::Plugin.new_output('copy')\nsupports_buffering = plugin.implement?(:buffered) || plugin.implement?(:delayed_commit)\nraise '<buffer> not supported by this plugin' if has_buffer_section && !supports_buffering","typeGuard":"# Type guard over plugin capabilities (Ruby)\ndef bufferable_output?(plugin_instance)\n  plugin_instance.implement?(:buffered) || plugin_instance.implement?(:delayed_commit)\nend\n\nbufferable_output?(Fluent::Plugin.new_output('http'))  # => true  (defines #write)\nbufferable_output?(Fluent::Plugin.new_output('copy'))  # => false (defines only #process)","tryCatchPattern":"# In config tooling:\nbegin\n  Fluent::Test::Driver::Output.new(plugin).configure(conf_str)\nrescue Fluent::ConfigError => e\n  fail \"buffer section rejected: #{e.message}\"\nend","preventionTips":["Check a plugin's processing contract before adding <buffer>: #write (buffered) or #try_write (delayed) — #process-only plugins reject it","Don't put <buffer> on out_copy/out_relabel-style routers; buffer the fan-out targets instead","Plugin authors: write a configure test with a <buffer> section so capability regressions fail in CI"],"tags":["fluentd","output-plugin","buffer","plugin-capability","configuration"],"backgroundTag":"buffering-not-supported","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}