{"record":{"id":"83d33eaf5a214136","repo":"fluent/fluentd","slug":"timekey-should-be-greater-than-0-current-timekey","errorCode":null,"errorMessage":"timekey should be greater than 0. current timekey: #{@timekey}","messagePattern":"timekey should be greater than 0\\. current timekey: #(.+?)","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":335,"sourceCode":"                    false\n                  end\n                end\n              rescue => e\n                raise Fluent::ConfigError, \"in chunk_keys: #{e.message}\"\n              end\n            }\n            raise Fluent::ConfigError, \"chunk_keys specification includes invalid char\"\n          else\n            @chunk_key_accessors = Hash[@chunk_keys.map { |key| [key.to_sym, Fluent::PluginHelper::RecordAccessor::Accessor.new(key)] }]\n          end\n\n          if @chunk_key_time\n            raise Fluent::ConfigError, \"<buffer ...> argument includes 'time', but timekey is not configured\" unless @buffer_config.timekey\n            Fluent::Timezone.validate!(@buffer_config.timekey_zone)\n            @timekey_zone = @buffer_config.timekey_use_utc ? '+0000' : @buffer_config.timekey_zone\n            @timekey = @buffer_config.timekey\n            if @timekey <= 0\n              raise Fluent::ConfigError, \"timekey should be greater than 0. current timekey: #{@timekey}\"\n            end\n            @timekey_use_utc = @buffer_config.timekey_use_utc\n            @offset = Fluent::Timezone.utc_offset(@timekey_zone)\n            @calculate_offset = @offset.respond_to?(:call) ? @offset : nil\n            @output_time_formatter_cache = {}\n          end\n\n          if (@chunk_key_tag ? 1 : 0) + @chunk_keys.size >= CHUNKING_FIELD_WARN_NUM\n            log.warn \"many chunk keys specified, and it may cause too many chunks on your system.\"\n          end\n\n          # no chunk keys or only tags (chunking can be done without iterating event stream)\n          @simple_chunking = !@chunk_key_time && @chunk_keys.empty?\n\n          @flush_mode = @buffer_config.flush_mode\n          if @flush_mode == :default\n            if has_flush_interval\n              log.info \"'flush_interval' is configured at out side of <buffer>. 'flush_mode' is set to 'interval' to keep existing behaviour\"","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L317-L353","documentation":"`timekey` was configured but parses to zero or negative seconds. timekey is a time-typed parameter, so `timekey 0`, `timekey -1h`, or a value that evaluates to 0 passes config parsing and is then rejected by the explicit `@timekey <= 0` check, because a non-positive window cannot bucket records.","triggerScenarios":"`timekey 0` (sometimes written intending 'no window'), `timekey -300`, or a computed/env-substituted value that resolves to 0. Raised at output.rb:335-337 during configure.","commonSituations":"Attempting to disable time chunking by zeroing the key; using an environment variable (`timekey #{ENV['WINDOW']}`) that is empty and coerces to 0; copy/paste from an example with a placeholder value.","solutions":["Set a positive window such as `timekey 5m`, `timekey 1h`, or `timekey 1d`","If you do not want time chunking, remove `time` from the chunk keys instead of zeroing timekey","Check env-substituted values actually resolve (e.g. `timekey #{ENV['FLUENT_TIMEKEY']}`)"],"exampleFix":"# before\n<buffer time>\n  @type file\n  timekey 0\n</buffer>\n\n# after\n<buffer time>\n  @type file\n  timekey 1h\n</buffer>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf\n# if timekey comes from env: echo \"timekey=#{ENV['FLUENT_TIMEKEY']}\" and assert > 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use timekey 0 to 'disable' chunking — remove the time key instead","Assert env-substituted durations are positive before starting fluentd","Reuse a small set of approved timekeys (5m/1h/1d)"],"tags":["fluentd","buffer","timekey","validation"],"backgroundTag":"invalid-parameter-value","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}