{"record":{"id":"bebaf549dd14d1ed","repo":"fluent/fluentd","slug":"failed-to-setup-secondary-plugin-in-conf-type","errorCode":null,"errorMessage":"Failed to setup secondary plugin in '#{conf['@type']}'. '#{secondary_type}' plugin in not allowed due to non buffered output","messagePattern":"Failed to setup secondary plugin in '#(.+?)'\\. '#(.+?)' plugin in not allowed due to non buffered output","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":415,"sourceCode":"          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\") &&\n             (self.class != @secondary.class) &&\n             (@custom_format || @secondary.implement?(:custom_format))\n            log.warn \"Use different plugin for secondary. Check the plugin works with primary like secondary_file\", primary: self.class.to_s, secondary: @secondary.class.to_s\n          end\n        else\n          @secondary = nil\n        end\n\n        self\n      end\n\n      def read_wait_to_kill_service_timeout\n        if Fluent.windows?\n          begin","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L397-L433","documentation":"The plugin instantiated for `<secondary>` does not respond to `acts_as_secondary`, meaning the class registered for that `@type` is not a Fluentd v1 output plugin. All modern outputs inherit `Fluent::Plugin::Output` (which defines `acts_as_secondary`), so this fires for non-output types, legacy/incompatible plugin classes, or plugins whose registration is broken.","triggerScenarios":"`<secondary> @type tail` (an input plugin), `@type buf_file` (a buffer plugin), an old v0.12-only output gem, or any type whose registered class lacks `acts_as_secondary`; `Plugin.new_output(secondary_type)` returns it and the `respond_to?` check at output.rb:414 fails. Also triggered when `@type` is omitted in `<secondary>` and the primary's type is re-used but is itself not secondary-capable.","commonSituations":"Pointing `<secondary>` at whatever plugin name seems related (a buffer, an input, a filter); using unmaintained gems after a fluentd major upgrade changed the plugin API.","solutions":["Use `@type secondary_file`, the purpose-built secondary plugin","Use a current v1-output plugin (updated gem version) that supports buffered writes","Set an explicit `@type` in `<secondary>` and verify it is an output plugin (`fluent-gem list`, plugin README)"],"exampleFix":"# before\n<secondary>\n  @type buf_file\n  path /var/log/fluent/backup\n</secondary>\n\n# after\n<secondary>\n  @type secondary_file\n  directory /var/log/fluent/backup\n</secondary>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf\n# verify the gem provides a v1 output: fluent-gem list | grep <plugin>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin maintained plugin versions; re-test after fluentd major upgrades","secondary must be an output plugin type, never a buffer/input/filter type","Prefer secondary_file unless you have a tested alternative"],"tags":["fluentd","secondary","plugin","compatibility"],"backgroundTag":"incompatible-plugin-version","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}