{"record":{"id":"9060139fb2121073","repo":"fluent/fluentd","slug":"type-is-required-in-storage","errorCode":null,"errorMessage":"@type is required in <storage>","messagePattern":"@type is required in <storage>","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/storage.rb","lineNumber":49,"sourceCode":"\n      def storage_create(usage: '', type: nil, conf: nil, default_type: nil)\n        if conf && conf.respond_to?(:arg) && !conf.arg.empty?\n          usage = conf.arg\n        end\n        if !usage.empty? && usage !~ /^[a-zA-Z][-_.a-zA-Z0-9]*$/\n          raise Fluent::ConfigError, \"Argument in <storage ARG> uses invalid characters: '#{usage}'\"\n        end\n\n        s = @_storages[usage]\n        if s&.running\n          return s.storage\n        elsif s\n          # storage is already created, but not loaded / started\n        else # !s\n          type = if type\n                   type\n                 elsif conf && conf.respond_to?(:[])\n                   raise Fluent::ConfigError, \"@type is required in <storage>\" unless conf['@type']\n                   conf['@type']\n                 elsif default_type\n                   default_type\n                 else\n                   raise ArgumentError, \"BUG: both type and conf are not specified\"\n                 end\n          storage = Plugin.new_storage(type, parent: self)\n          config = case conf\n                   when Fluent::Config::Element\n                     conf\n                   when Hash\n                     # in code, programmer may use symbols as keys, but Element needs strings\n                     conf = Hash[conf.map{|k,v| [k.to_s, v]}]\n                     Fluent::Config::Element.new('storage', usage, conf, [])\n                   when nil\n                     Fluent::Config::Element.new('storage', usage, {'@type' => type}, [])\n                   else\n                     raise ArgumentError, \"BUG: conf must be a Element, Hash (or unspecified), but '#{conf.class}'\"","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/storage.rb#L31-L67","documentation":"Error \"@type is required in <storage>\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/plugin_helper/storage.rb:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}