{"record":{"id":"5953ce0501d80f6f","repo":"hashicorp/terraform","slug":"no-schema-found-for-s","errorCode":null,"errorMessage":"no schema found for %s","messagePattern":"no schema found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonplan/values.go","lineNumber":203,"sourceCode":"\t\tswitch r.Addr.Resource.Resource.Mode {\n\t\tcase addrs.ManagedResourceMode:\n\t\t\tresource.Mode = \"managed\"\n\t\tcase addrs.DataResourceMode:\n\t\t\tresource.Mode = \"data\"\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"resource %s has an unsupported mode %s\",\n\t\t\t\tr.Addr.String(),\n\t\t\t\tr.Addr.Resource.Resource.Mode.String(),\n\t\t\t)\n\t\t}\n\n\t\tschema := schemas.ResourceTypeConfig(\n\t\t\tr.ProviderAddr.Provider,\n\t\t\tr.Addr.Resource.Resource.Mode,\n\t\t\tresource.Type,\n\t\t)\n\t\tif schema.Body == nil {\n\t\t\treturn nil, fmt.Errorf(\"no schema found for %s\", r.Addr.String())\n\t\t}\n\t\tresource.SchemaVersion = uint64(schema.Version)\n\t\tchangeV, err := r.Decode(schema)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// copy the marked After values so we can use these in marshalSensitiveValues\n\t\tmarkedAfter := changeV.After\n\n\t\t// The values may be marked, but we must rely on the Sensitive flag\n\t\t// as the decoded value is only an intermediate step in transcoding\n\t\t// this to a json format.\n\t\tchangeV.Before, _ = changeV.Before.UnmarkDeep()\n\t\tchangeV.After, _ = changeV.After.UnmarkDeep()\n\n\t\tif changeV.After != cty.NilVal {\n\t\t\tif changeV.After.IsWhollyKnown() {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/jsonplan/values.go#L185-L221","documentation":"Thrown by jsonplan when schemas.ResourceTypeConfig returns a schema whose Body is nil for the resource being planned. A nil body means the loaded provider schema has no definition for that resource type (mode+type+provider), so Terraform cannot decode/transcode the planned value to JSON.","triggerScenarios":"The resource type in the configuration is not declared by the provider's schema; the provider partially failed to load and produced an incomplete schema; the wrong provider source/version is configured.","commonSituations":"Typo in the resource type name; `terraform init` not run or run against the wrong provider; provider version too old to define the type, or so new the type was removed/renamed; provider plugin error during schema retrieval that left a partial schema.","solutions":["Run `terraform init` to (re)download the provider and rebuild the schema cache.","Verify the resource type spelling and the provider source/version in required_providers.","Check provider logs/output for schema-load errors and resolve them.","Pin a provider version known to define the resource type, then `terraform init -upgrade`."],"exampleFix":"# before\nresource \"aws_instance\" \"x\" { ... }   # typo or undefined type\n\n# after\nresource \"aws_instance\" \"web\" { ... }  # correct type after terraform init","handlingStrategy":"validation","validationCode":"// Ensure the provider schema actually defines the resource type before marshaling.\nschema := schemas.ResourceTypeConfig(provider, mode, resourceType)\nif schema.Body == nil {\n    return fmt.Errorf(\"provider %s has no schema for %s; run 'terraform init' and check the resource type\", provider, resourceType)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `terraform init` (and `-upgrade` when changing providers) so the schema cache is complete.","Double-check resource type spelling against the provider's documentation.","Pin provider versions known to define the resource types you use."],"tags":["terraform","json-plan","schema","provider","misconfiguration"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}