{"record":{"id":"c8a144ea54dc8439","repo":"fluent/fluentd","slug":"name-key-must-be-a-klass-but-opts-key","errorCode":null,"errorMessage":"#{name}: #{key} must be a #{klass}, but #{opts[key].class}","messagePattern":"#(.+?): #(.+?) must be a #(.+?), but #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/fluent/config/configure_proxy.rb","lineNumber":214,"sourceCode":"          merged.sections[section_key] = merged_section\n        end\n\n        merged\n      end\n\n      def overwrite_defaults(other) # other is owner plugin's corresponding proxy\n        self.defaults = self.defaults.merge(other.defaults)\n        self.sections.each_key do |section_key|\n          if other.sections.has_key?(section_key)\n            self.sections[section_key].overwrite_defaults(other.sections[section_key])\n          end\n        end\n      end\n\n      def option_value_type!(name, opts, key, klass=nil, type: nil)\n        if opts.has_key?(key)\n          if klass && !opts[key].is_a?(klass)\n            raise ArgumentError, \"#{name}: #{key} must be a #{klass}, but #{opts[key].class}\"\n          end\n          case type\n          when :boolean\n            unless opts[key].is_a?(TrueClass) || opts[key].is_a?(FalseClass)\n              raise ArgumentError, \"#{name}: #{key} must be true or false, but #{opts[key].class}\"\n            end\n          when nil\n            # ignore\n          else\n            raise \"unknown type: #{type} for option #{key}\"\n          end\n        end\n      end\n\n      def config_parameter_option_validate!(name, type, **kwargs, &block)\n        if type.nil? && !block\n          type = :string\n        end","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/config/configure_proxy.rb#L196-L232","documentation":"Error \"#{name}: #{key} must be a #{klass}, but #{opts[key].class}\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/config/configure_proxy.rb:214 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"}