fluent/fluentd · error · Fluent::ConfigError

@type is required in <storage>

Error message

@type is required in <storage>

What it means

Error "@type is required in <storage>" thrown in fluent/fluentd.

Source

Thrown at lib/fluent/plugin_helper/storage.rb:49

      def storage_create(usage: '', type: nil, conf: nil, default_type: nil)
        if conf && conf.respond_to?(:arg) && !conf.arg.empty?
          usage = conf.arg
        end
        if !usage.empty? && usage !~ /^[a-zA-Z][-_.a-zA-Z0-9]*$/
          raise Fluent::ConfigError, "Argument in <storage ARG> uses invalid characters: '#{usage}'"
        end

        s = @_storages[usage]
        if s&.running
          return s.storage
        elsif s
          # storage is already created, but not loaded / started
        else # !s
          type = if type
                   type
                 elsif conf && conf.respond_to?(:[])
                   raise Fluent::ConfigError, "@type is required in <storage>" unless conf['@type']
                   conf['@type']
                 elsif default_type
                   default_type
                 else
                   raise ArgumentError, "BUG: both type and conf are not specified"
                 end
          storage = Plugin.new_storage(type, parent: self)
          config = case conf
                   when Fluent::Config::Element
                     conf
                   when Hash
                     # in code, programmer may use symbols as keys, but Element needs strings
                     conf = Hash[conf.map{|k,v| [k.to_s, v]}]
                     Fluent::Config::Element.new('storage', usage, conf, [])
                   when nil
                     Fluent::Config::Element.new('storage', usage, {'@type' => type}, [])
                   else
                     raise ArgumentError, "BUG: conf must be a Element, Hash (or unspecified), but '#{conf.class}'"

View on GitHub (pinned to dd45c6e18d)

When it happens

Trigger: Thrown at lib/fluent/plugin_helper/storage.rb:49 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of fluent/fluentd@dd45c6e18d (2026-08-21). Data as JSON: /api/errors/9060139fb2121073. Report an issue: GitHub.