{"record":{"id":"a155dee3635343bf","repo":"fluent/fluentd","slug":"flush-interval-can-t-be-specified-when-flush-mo","errorCode":null,"errorMessage":"'flush_interval' can't be specified when 'flush_mode' is not 'interval' explicitly: '#{@flush_mode}'","messagePattern":"'flush_interval' can't be specified when 'flush_mode' is not 'interval' explicitly: '#(.+?)'","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":389,"sourceCode":"                                 else\n                                   true # flush_at_shutdown is true in default for on-memory buffer\n                                 end\n          elsif !@flush_at_shutdown && !@buffer.persistent?\n            buf_type = Plugin.lookup_type_from_class(@buffer.class)\n            log.warn \"'flush_at_shutdown' is false, and buffer plugin '#{buf_type}' is not persistent buffer.\"\n            log.warn \"your configuration will lose buffered data at shutdown. please confirm your configuration again.\"\n          else\n            if Fluent.windows? && @buffer.persistent?\n              service_timeout = read_wait_to_kill_service_timeout\n              if service_timeout && service_timeout <= 5000 # default value might varies on windows client/server\n                log.warn \"your WaitToKillServiceTimeout=#{service_timeout} registry configuration seems too short. Recommend to extend the value of 'HKLM\\\\SYSTEM\\\\CurrentControlSet\\\\Control\\\\WaitToKillServiceTimeout' to prevent buffer corruption from a forced shutdown\"\n              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","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L371-L407","documentation":"`flush_interval` only takes effect when `flush_mode` is `interval`; Fluentd makes it a hard error if `flush_interval` is set while `flush_mode` is explicitly set to something else (`lazy`, `periodic`). If `flush_mode` were left at its default this would only be a warning — the raise happens specifically when you wrote both options and they contradict.","triggerScenarios":"A buffer block containing both `flush_mode lazy` (or `periodic`) and `flush_interval 5s`. The check `(@flush_mode != :interval) && buffer_conf.has_key?('flush_interval')` combined with `buffer_conf.has_key?('flush_mode')` at output.rb:387-390 raises during configure.","commonSituations":"Editing an existing config that used interval flushing to lazy mode but leaving `flush_interval` behind; merging config snippets from different docs; CI catching this only after a fluentd upgrade tightened the warning into an error.","solutions":["Remove `flush_interval` when using `flush_mode lazy` or `periodic`","Or set `flush_mode interval` if interval flushing is what you want","For periodic-style behavior use `flush_thread_interval`/`flush_thread_burst_interval` instead of mixing modes"],"exampleFix":"# before\n<buffer tag>\n  @type file\n  flush_mode lazy\n  flush_interval 5s\n</buffer>\n\n# after\n<buffer tag>\n  @type file\n  flush_mode lazy\n</buffer>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf\n# lint: flag any buffer block containing both flush_mode (non-interval) and flush_interval","typeGuard":null,"tryCatchPattern":null,"preventionTips":["flush_interval belongs only with flush_mode interval (or default mode)","When switching flush modes, grep the config for leftover flush_interval","Know the pairs: lazy uses chunk limits, periodic uses flush_thread_interval, interval uses flush_interval"],"tags":["fluentd","buffer","flush-mode","configuration"],"backgroundTag":"conflicting-config-options","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}