{"record":{"id":"532dad3eb31787e7","repo":"hashicorp/terraform","slug":"no-schema-found-for-s-in-provider-s","errorCode":null,"errorMessage":"no schema found for %s (in provider %s)","messagePattern":"no schema found for (.+?) \\(in provider (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/command/jsonconfig/config.go","lineNumber":507,"sourceCode":"\t\t}\n\n\t\tcExp := marshalExpression(v.Count)\n\t\tif !cExp.Empty() {\n\t\t\tr.CountExpression = &cExp\n\t\t} else {\n\t\t\tfExp := marshalExpression(v.ForEach)\n\t\t\tif !fExp.Empty() {\n\t\t\t\tr.ForEachExpression = &fExp\n\t\t\t}\n\t\t}\n\n\t\tschema := schemas.ResourceTypeConfig(\n\t\t\tv.Provider,\n\t\t\tv.Mode,\n\t\t\tv.Type,\n\t\t)\n\t\tif schema.Body == nil {\n\t\t\treturn nil, fmt.Errorf(\"no schema found for %s (in provider %s)\", v.Addr().String(), v.Provider)\n\t\t}\n\t\tr.SchemaVersion = uint64(schema.Version)\n\n\t\tr.Expressions = marshalExpressions(v.Config, schema.Body)\n\n\t\t// Managed is populated only for Mode = addrs.ManagedResourceMode\n\t\tif v.Managed != nil && len(v.Managed.Provisioners) > 0 {\n\t\t\tvar provisioners []provisioner\n\t\t\tfor _, p := range v.Managed.Provisioners {\n\t\t\t\tschema := schemas.ProvisionerConfig(p.Type)\n\t\t\t\tprov := provisioner{\n\t\t\t\t\tType:        p.Type,\n\t\t\t\t\tExpressions: marshalExpressions(p.Config, schema),\n\t\t\t\t}\n\t\t\t\tprovisioners = append(provisioners, prov)\n\t\t\t}\n\t\t\tr.Provisioners = provisioners\n\t\t}","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/command/jsonconfig/config.go#L489-L525","documentation":"Returned by jsonconfig.marshalResources when schemas.ResourceTypeConfig(provider, mode, type).Body is nil — meaning no schema exists for the given resource type within its provider (config.go:501-507). The %s placeholders are the resource address and the provider address. Without a schema Terraform cannot marshal the resource's expressions, so it aborts.","triggerScenarios":"Running `terraform show -json` / jsonconfig.Marshal when the loaded schema set has no entry for a resource type referenced by the config/state. This happens when the provider that defines the resource is not installed, a different/older provider version is in the schema cache, or the resource type was renamed/removed upstream.","commonSituations":"Forgetting `terraform init` so providers (and thus schemas) aren't loaded before `terraform show -json`; a state file referencing a resource type no longer present in the installed provider version; provider swapped for a fork that dropped the resource; lock file pins an old provider lacking the resource.","solutions":["Run `terraform init` to install the required providers and populate the schema cache before show -json.","Update the provider to a version that includes the resource type (or pin required_providers to a version that has it).","Remove or import the orphaned resource from state if the resource type was legitimately removed.","Verify the resource type name spelling and the provider source address in required_providers."],"exampleFix":"# before\n$ terraform show -json   # provider not installed\n# after\n$ terraform init\n$ terraform show -json","handlingStrategy":"validation","validationCode":"// Verify the provider schema exposes every resource type before Marshal.\nfor addr, res := range module.ManagedResources {\n    if schemas.ResourceTypeConfig(res.Provider, res.Mode, res.Type).Body == nil {\n        return fmt.Errorf(\"no schema for %s; run terraform init\", addr)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run `terraform init` to load provider schemas before `terraform show -json`.","Keep required_providers pinned to versions that define the resource types you use.","Re-run init after upgrading/downgrading a provider that adds/removes resource types."],"tags":["terraform-jsonconfig","schema","provider","missing-resource-type"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}