{"record":{"id":"327b08044762066b","repo":"fluent/fluentd","slug":"time-type-is-mixed-but-time-format-and-time-forma","errorCode":null,"errorMessage":"time_type is :mixed but time_format and time_format_fallbacks is empty.","messagePattern":"time_type is :mixed but time_format and time_format_fallbacks is empty\\.","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/time.rb","lineNumber":177,"sourceCode":"            conf['localtime'] = Fluent::Config.bool_value(conf['localtime'])\n          elsif conf.has_key?('utc')\n            conf['localtime'] = !(Fluent::Config.bool_value(conf['utc']))\n            # Specifying \"localtime false\" means using UTC in TimeFormatter\n            # And specifying \"utc\" is different from specifying \"timezone +0000\"(it's not always UTC).\n            # There are difference between \"Z\" and \"+0000\" in timezone formatting.\n            # TODO: add kwargs to TimeFormatter to specify \"using localtime\", \"using UTC\" or \"using specified timezone\" in more explicit way\n          end\n        end\n\n        super\n\n        if conf.has_key?('localtime') && conf.has_key?('utc') && !(@localtime ^ @utc)\n          raise Fluent::ConfigError, \"both of utc and localtime are specified, use only one of them\"\n        end\n\n        if conf.has_key?('time_type') and @time_type == :mixed\n          if @time_format.nil? and @time_format_fallbacks.empty?\n            raise Fluent::ConfigError, \"time_type is :mixed but time_format and time_format_fallbacks is empty.\"\n          end\n        end\n\n        Fluent::Timezone.validate!(@timezone) if @timezone\n      end\n    end\n\n    module Parser\n      def self.included(mod)\n        mod.include TimeParameters\n      end\n\n      def time_parser_create(type: @time_type, format: @time_format, timezone: @timezone, force_localtime: false)\n        return MixedTimeParser.new(type, format, @localtime, timezone, @utc, force_localtime, @time_format_fallbacks) if type == :mixed\n        return NumericTimeParser.new(type) if type != :string\n        return TimeParser.new(format, true, nil) if force_localtime\n\n        localtime = @localtime && (timezone.nil? && !@utc)","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/time.rb#L159-L195","documentation":"Fluent::ConfigError raised in TimeParameters#configure (lib/fluent/time.rb:177) when time_type is set to :mixed but neither time_format nor time_format_fallbacks provides any format. The :mixed mode works by trying a primary format and then fallback parsers (e.g. unixtime, %iso8601), so with no formats configured there is nothing to parse with and startup fails.","triggerScenarios":"A parser/formatter section with time_type mixed and no time_format / time_format_fallbacks lines; also when time_format is present but empty. Valid usage is either 'time_format + time_type mixed (+ optional fallbacks)' or 'time_type mixed + time_format_fallbacks' listing at least one format.","commonSituations":"Enabling time_type mixed to accept both epoch seconds and ISO8601 but forgetting the fallbacks line; renaming time_format_fallbacks to a wrong key so it is silently ignored and only time_type remains; upgrading a config where time_type mixed was added experimentally.","solutions":["Add time_format_fallbacks listing the formats to try, e.g. time_type mixed + time_format_fallbacks %iso8601, unixtime","Or specify a primary time_format plus fallbacks: time_format %iso8601 and time_type mixed with time_format_fallbacks unixtime","If you only ever have one timestamp shape, drop time_type mixed entirely — the default parser with a single time_format is simpler"],"exampleFix":"# before\n<parse>\n  @type regexp\n  time_key time\n  time_type mixed\n</parse>\n\n# after\n<parse>\n  @type regexp\n  time_key time\n  time_type mixed\n  time_format %iso8601\n  time_format_fallbacks unixtime\n</parse>","handlingStrategy":"validation","validationCode":"time_type = 'mixed'\ntime_format = nil\ntime_format_fallbacks = []\nif time_type == :mixed && time_format.nil? && time_format_fallbacks.empty?\n  raise 'time_type mixed requires time_format and/or time_format_fallbacks'\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat time_type mixed as 'format list mode': always write at least one format next to it","Use the two canonical shapes from the docs: time_format + fallbacks, or fallbacks alone","Dry-run configs in CI"],"tags":["fluentd","configuration","time","mixed-parser","time-format","startup"],"backgroundTag":"missing-config-value","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}