{"record":{"id":"0bc4e483667f7483","repo":"hashicorp/terraform","slug":"unknown-type-s-0bc4e4","errorCode":null,"errorMessage":"Unknown type: %s","messagePattern":"Unknown type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/legacy/helper/schema/field_reader_config.go","lineNumber":141,"sourceCode":"\t\tif schema.PromoteSingle {\n\t\t\tresult, err := r.readPrimitive(k, schema.Elem.(*Schema))\n\t\t\tif err == nil && result.Exists {\n\t\t\t\tresult.Value = []interface{}{result.Value}\n\t\t\t\treturn result, nil\n\t\t\t}\n\t\t}\n\n\t\treturn readListField(&nestedConfigFieldReader{r}, address, schema)\n\tcase TypeMap:\n\t\treturn r.readMap(k, schema)\n\tcase TypeSet:\n\t\treturn r.readSet(address, schema)\n\tcase typeObject:\n\t\treturn readObjectField(\n\t\t\t&nestedConfigFieldReader{r},\n\t\t\taddress, schema.Elem.(map[string]*Schema))\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Unknown type: %s\", schema.Type))\n\t}\n}\n\nfunc (r *ConfigFieldReader) readMap(k string, schema *Schema) (FieldReadResult, error) {\n\t// We want both the raw value and the interpolated. We use the interpolated\n\t// to store actual values and we use the raw one to check for\n\t// computed keys. Actual values are obtained in the switch, depending on\n\t// the type of the raw value.\n\tmraw, ok := r.Config.GetRaw(k)\n\tif !ok {\n\t\t// check if this is from an interpolated field by seeing if it exists\n\t\t// in the config\n\t\t_, ok := r.Config.Get(k)\n\t\tif !ok {\n\t\t\t// this really doesn't exist\n\t\t\treturn FieldReadResult{}, nil\n\t\t}\n","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/legacy/helper/schema/field_reader_config.go#L123-L159","documentation":"A panic in `ConfigFieldReader.readField` (internal/legacy/helper/schema/field_reader_config.go:141), default branch of the switch over `schema.Type`. The config-backed reader handles TypeBool/TypeInt/TypeFloat/TypeString/TypeList/TypeMap/TypeSet/typeObject; any other value panics with 'Unknown type: %s'. This is a malformed-schema / provider-bug condition specific to the config-source field reader.","triggerScenarios":"Reading a field from HCL config via the legacy ConfigFieldReader when the corresponding schema entry has a Type outside the recognized set (unset TypeInvalid, or a constant the reader does not know).","commonSituations":"Provider schema with an unset or invalid Type on an attribute; SDK version drift introducing/removing a ValueType; a schema entry that was supposed to be a collection but got a scalar constant or vice versa.","solutions":["Find the schema attribute whose Type is invalid and set it to a valid ValueType.","Add a schema self-test in the provider that asserts every attribute has a known Type.","Pin the provider SDK version consistent with the schema code.","Report/fix in the provider repo with a minimal resource definition."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Go (provider): validate all schema Types handled by the config reader\nfor name, s := range resource.Schema {\n    switch s.Type {\n    case schema.TypeString, schema.TypeBool, schema.TypeInt, schema.TypeFloat,\n         schema.TypeList, schema.TypeMap, schema.TypeSet:\n    default:\n        return fmt.Errorf(\"config reader cannot handle schema %q Type %d\", name, s.Type)\n    }\n}","typeGuard":"// Go: guard a schema Type is config-reader-compatible\nfunc configReadableType(t schema.ValueType) bool {\n    switch t {\n    case schema.TypeString, schema.TypeBool, schema.TypeInt, schema.TypeFloat,\n         schema.TypeList, schema.TypeMap, schema.TypeSet:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Set a valid, recognized Type on every schema attribute.","Add schema self-tests rejecting TypeInvalid.","Keep provider SDK versions consistent across plan and apply.","Audit schema definitions during code review for missing Type fields."],"tags":["terraform","provider-sdk","legacy-schema","field-reader","config-reader","panic","schema-type","provider-bug"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}