{"record":{"id":"0a8eaf74387aa4c4","repo":"fluent/fluentd","slug":"this-plugin-self-class-cannot-handle-argument","errorCode":null,"errorMessage":"this plugin '#{self.class}' cannot handle arguments for <buffer ...> section","messagePattern":"this plugin '#(.+?)' cannot handle arguments for <buffer \\.\\.\\.> section","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"critical","filePath":"lib/fluent/compat/output.rb","lineNumber":289,"sourceCode":"\n          conf.elements << Fluent::Config::Element.new('buffer', '', buf_params, [])\n        end\n\n        @includes_record_filter = self.class.ancestors.include?(Fluent::Compat::RecordFilterMixin)\n\n        methods_of_plugin = self.class.instance_methods(false)\n        @overrides_emit = methods_of_plugin.include?(:emit)\n        # RecordFilter mixin uses its own #format_stream method implementation\n        @overrides_format_stream = methods_of_plugin.include?(:format_stream) || @includes_record_filter\n\n        ParserUtils.convert_parser_conf(conf)\n        FormatterUtils.convert_formatter_conf(conf)\n\n        super\n\n        if config_style == :v1\n          unless @buffer_config.chunk_keys.empty?\n            raise Fluent::ConfigError, \"this plugin '#{self.class}' cannot handle arguments for <buffer ...> section\"\n          end\n        end\n\n        self.extend BufferedChunkMixin\n\n        if @overrides_emit\n          self.singleton_class.module_eval do\n            attr_accessor :last_emit_via_buffer\n          end\n          output_plugin = self\n          m = Module.new do\n            define_method(:emit) do |key, data, chain|\n              # receivers of this method are buffer instances\n              output_plugin.last_emit_via_buffer = [key, data]\n            end\n          end\n          @buffer.extend m\n        end","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/compat/output.rb#L271-L307","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the chunk-key argument so the section is a bare <buffer> (no argument), which the check permits","Or drop the <buffer> section entirely and use the plugin's v0.12 parameters (buffer_type, flush_interval, retry_limit, buffer_chunk_limit)","Best: upgrade the plugin to a v1-API release or switch to an equivalent v1 output plugin","Validate with fluentd --dry-run before deploying"],"exampleFix":"# before (v0.12 BufferedOutput plugin + v1-style section)\n<match app.**>\n  @type legacy_output\n  <buffer my_key>\n    @type memory\n  </buffer>\n</match>\n\n# after\n<match app.**>\n  @type legacy_output\n  <buffer>\n    @type memory\n  </buffer>\n</match>","handlingStrategy":"validation","validationCode":"# catch it before deploy:\n#   fluentd --dry-run -c /etc/fluent/fluent.conf\n# in code, detect the incompatible combination:\nlegacy_plugin = plugin.class.ancestors.any? { |a| a.name == 'Fluent::Compat::BufferedOutput' }\nbuffer_args = conf.elements.find { |e| e.name == 'buffer' }&.arg.to_s.strip\nabort 'legacy BufferedOutput plugin cannot take <buffer KEY> args' if legacy_plugin && !buffer_args.empty?","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Know each output plugin's API generation before writing <buffer> sections","Keep configs and plugin versions upgraded together","Always dry-run configs against the exact production gem set"],"tags":["fluentd","config","buffer","v012-compat","plugin-migration"],"backgroundTag":"plugin-api-version-mismatch","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}