{"record":{"id":"b99b44cef9f84437","repo":"hashicorp/terraform","slug":"missing-provider-schema-b99b44","errorCode":null,"errorMessage":"missing provider schema","messagePattern":"missing provider schema","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/plugin6/grpc_provider.go","lineNumber":146,"sourceCode":"\t// Note: this option is marked as EXPERIMENTAL in the grpc API. We keep\n\t// this for compatibility, but recent providers all set the max message\n\t// size much higher on the server side, which is the supported method for\n\t// determining payload size.\n\tconst maxRecvSize = 64 << 20\n\tprotoResp, err := p.client.GetProviderSchema(p.ctx, new(proto6.GetProviderSchema_Request), grpc.MaxRecvMsgSizeCallOption{MaxRecvMsgSize: maxRecvSize})\n\tif err != nil {\n\t\tresp.Diagnostics = resp.Diagnostics.Append(grpcErr(err))\n\t\treturn resp\n\t}\n\n\tresp.Diagnostics = resp.Diagnostics.Append(convert.ProtoToDiagnostics(protoResp.Diagnostics))\n\n\tif resp.Diagnostics.HasErrors() {\n\t\treturn resp\n\t}\n\n\tif protoResp.Provider == nil {\n\t\tresp.Diagnostics = resp.Diagnostics.Append(errors.New(\"missing provider schema\"))\n\t\treturn resp\n\t}\n\n\tidentResp, err := p.client.GetResourceIdentitySchemas(p.ctx, new(proto6.GetResourceIdentitySchemas_Request))\n\tif err != nil {\n\t\tif status.Code(err) == codes.Unimplemented {\n\t\t\t// We don't treat this as an error if older providers don't implement this method,\n\t\t\t// so we create an empty map for identity schemas\n\t\t\tidentResp = &proto6.GetResourceIdentitySchemas_Response{\n\t\t\t\tIdentitySchemas: map[string]*proto6.ResourceIdentitySchema{},\n\t\t\t}\n\t\t} else {\n\t\t\tresp.Diagnostics = resp.Diagnostics.Append(grpcErr(err))\n\t\t\treturn resp\n\t\t}\n\t}\n\n\tresp.Diagnostics = resp.Diagnostics.Append(convert.ProtoToDiagnostics(identResp.Diagnostics))","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/plugin6/grpc_provider.go#L128-L164","documentation":"Thrown by the Terraform plugin v6 gRPC client (GRPCProvider.GetProviderSchema) when GetProviderSchema succeeded without diagnostics but the response `Provider` field is nil. Identical semantics to the v5 'missing provider schema' error: the provider must declare a top-level provider schema, and a nil one is a provider defect. The v6 path then continues to fetch resource identity schemas.","triggerScenarios":"A v6-protocol provider's GetProviderSchema handler returned Provider == nil with no error. Protocol-version mismatch, a mis-built v6 provider, or a provider crash yielding an empty response.","commonSituations":"Provider built against terraform-plugin-go/terraform-plugin-framework v6 that omits the provider schema. Corrupted plugin cache. Version skew between core and provider.","solutions":["Upgrade or pin a compatible v6 provider version; run `terraform init -upgrade`.","Clear the plugin cache (.terraform/providers) and re-init.","If you maintain the provider, ensure the framework provider schema is declared and returned.","Check provider logs for a crash during schema serving."],"exampleFix":"# before: v6 provider returns nil schema\n# provider-side: declare schema in terraform-plugin-framework provider\n\n# user-side:\n$ terraform init -upgrade","handlingStrategy":"retry","validationCode":"# shell: verify the v6 provider serves a schema\n$ terraform providers schema -json | jq '.provider_schemas'","typeGuard":null,"tryCatchPattern":"# bash: clear cache and re-init on schema failure\nif ! terraform init 2>err.log; then\n  if grep -q 'missing provider schema' err.log; then\n    rm -rf .terraform/providers && terraform init -upgrade\n  else cat err.log; exit 1; fi\nfi","preventionTips":["Pin v6 providers to compatible versions in required_providers.","Keep the plugin cache clean.","Run terraform validate in CI.","For provider authors, always return a non-nil provider schema from the framework."],"tags":["terraform","provider","grpc","plugin-v6","schema"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}