{"record":{"id":"165a5650ab2d77da","repo":"hashicorp/terraform","slug":"no-schema-found-for-s-in-provider-s-165a56","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/jsonplan/plan.go","lineNumber":462,"sourceCode":"\n\treturn ret, nil\n}\n\nfunc marshalResourceChange(rc *plans.ResourceInstanceChangeSrc, schemas *terraform.Schemas) (ResourceChange, error) {\n\tvar r ResourceChange\n\taddr := rc.Addr\n\tr.Address = addr.String()\n\tif !addr.Equal(rc.PrevRunAddr) {\n\t\tr.PreviousAddress = rc.PrevRunAddr.String()\n\t}\n\n\tschema := schemas.ResourceTypeConfig(\n\t\trc.ProviderAddr.Provider,\n\t\taddr.Resource.Resource.Mode,\n\t\taddr.Resource.Resource.Type,\n\t)\n\tif schema.Body == nil {\n\t\treturn r, fmt.Errorf(\"no schema found for %s (in provider %s)\", r.Address, rc.ProviderAddr.Provider)\n\t}\n\n\tchangeV, err := rc.Decode(schema)\n\tif err != nil {\n\t\treturn r, err\n\t}\n\t// We drop the marks from the change, as decoding is only an\n\t// intermediate step to re-encode the values as json\n\tchangeV.Before, _ = changeV.Before.UnmarkDeep()\n\tchangeV.After, _ = changeV.After.UnmarkDeep()\n\n\tvar before, after []byte\n\tvar beforeSensitive, afterSensitive []byte\n\tvar afterUnknown cty.Value\n\n\tif changeV.Before != cty.NilVal {\n\t\tbefore, err = ctyjson.Marshal(changeV.Before, changeV.Before.Type())\n\t\tif err != nil {","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/command/jsonplan/plan.go#L444-L480","documentation":"Returned by marshalResourceChange: schemas.ResourceTypeConfig returned a schema whose Body is nil, meaning the provider does not advertise the resource type (in the given mode) that the plan change references. The resource change cannot be decoded without a schema.","triggerScenarios":"Provider plugin version that does not define the resource type; provider not initialized; stale plugin cache; managed-resource vs data-source mode mismatch in the address.","commonSituations":"Provider downgrade that removed a resource type; CI locked to an older provider; resource renamed/removed upstream; state referencing a type the current provider no longer ships.","solutions":["Run `terraform init -upgrade` to fetch a provider version that defines the resource type.","Verify the provider version in .terraform.lock.hcl supports the resource type named in the error.","Regenerate the plan with the current provider set.","If the resource type was intentionally removed, remove it from config and state before re-planning."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check the resource type schema is present for a change before marshaling.\nfunc resourceSchemaOk(schemas *terraform.Schemas, provider addrs.Provider, mode addrs.ResourceMode, typ string) bool {\n    s := schemas.ResourceTypeConfig(provider, mode, typ)\n    return s.Body != nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin provider versions that define every resource type used in config and state.","Run `terraform init` (or `-upgrade`) before planning.","Remove obsolete resources from config and state before re-planning."],"tags":["go","terraform","plan","resource","schema","provider","jsonplan"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}