{"record":{"id":"549393b76a38995a","repo":"fluent/fluentd","slug":"invalid-secondary-section-for-non-buffered-plugi","errorCode":null,"errorMessage":"Invalid <secondary> section for non-buffered plugin","messagePattern":"Invalid <secondary> section for non-buffered plugin","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":401,"sourceCode":"              end\n            end\n          end\n\n          if (@flush_mode != :interval) && buffer_conf.has_key?('flush_interval')\n            if buffer_conf.has_key?('flush_mode')\n              raise Fluent::ConfigError, \"'flush_interval' can't be specified when 'flush_mode' is not 'interval' explicitly: '#{@flush_mode}'\"\n            else\n              log.warn \"'flush_interval' is ignored because default 'flush_mode' is not 'interval': '#{@flush_mode}'\"\n            end\n          end\n\n          if @buffer.queued_chunks_limit_size.nil?\n            @buffer.queued_chunks_limit_size = @buffer_config.flush_thread_count\n          end\n        end\n\n        if @secondary_config\n          raise Fluent::ConfigError, \"Invalid <secondary> section for non-buffered plugin\" unless @buffering\n          raise Fluent::ConfigError, \"<secondary> section cannot have <buffer> section\" if @secondary_config.buffer\n          raise Fluent::ConfigError, \"<secondary> section cannot have <secondary> section\" if @secondary_config.secondary\n          if @buffer_config.retry_forever\n            log.warn \"<secondary> with 'retry_forever', only unrecoverable errors are moved to secondary\"\n          end\n\n          secondary_type = @secondary_config[:@type]\n          unless secondary_type\n            secondary_type = conf['@type'] # primary plugin type\n          end\n          secondary_conf = conf.elements(name: 'secondary').first\n          @secondary = Plugin.new_output(secondary_type)\n          unless @secondary.respond_to?(:acts_as_secondary)\n            raise Fluent::ConfigError, \"Failed to setup secondary plugin in '#{conf['@type']}'. '#{secondary_type}' plugin in not allowed due to non buffered output\"\n          end\n          @secondary.acts_as_secondary(self)\n          @secondary.configure(secondary_conf)\n          if (@secondary.class.to_s != \"Fluent::Plugin::SecondaryFileOutput\") &&","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L383-L419","documentation":"A `<secondary>` section was configured under an output plugin that does not buffer at all (`@buffering` is false, i.e. the plugin only implements synchronous `#process`). Secondary output exists solely to receive buffered chunks after retry limits, so it is meaningless — and rejected — for non-buffered outputs, which have no retry queue.","triggerScenarios":"`<match **> @type stdout ... <secondary> ... </secondary>` or `@type copy`/`@type null` with a nested `<secondary>` element; `@secondary_config` is non-nil while `@buffering` is false, so output.rb:401 raises during configure.","commonSituations":"Pasting a `<secondary>` block into a config whose primary was switched to a synchronous plugin; misunderstanding that `<secondary>` is not a general 'send a copy elsewhere' directive (that is `<match>` + copy).","solutions":["Remove the `<secondary>` section from the non-buffered output","Use `@type copy` with two destinations if the goal is dual delivery, not failover","Switch the primary to a buffered output (file, forward, s3, ...) if you actually need retry + secondary semantics"],"exampleFix":"# before\n<match app.**>\n  @type stdout\n  <secondary>\n    @type secondary_file\n    directory /var/log/fluent/backup\n  </secondary>\n</match>\n\n# after (stdout is synchronous; no secondary is possible)\n<match app.**>\n  @type stdout\n</match>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Remember `<secondary>` requires a buffered primary (file/forward/s3...)\n","Use `copy` for fan-out, `<secondary>` only for retry fallback","Dry-run catches this before any traffic flows"],"tags":["fluentd","secondary","buffer","configuration"],"backgroundTag":"config-validation-failed","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}