Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Source Type Not Found or Resource Type Not Found when using Terraform 1.6 #853

Closed
austinvalle opened this issue Oct 6, 2023 · 2 comments · Fixed by #852
Closed
Labels
bug Something isn't working

Comments

@austinvalle
Copy link
Member

austinvalle commented Oct 6, 2023

This is a Framework bug affecting users of Terraform 1.6 using providers built using Plugin Framework 1.4.0. The root cause is the recent caching functionality being enabled in #828.

Module version

github.com/hashicorp/terraform-plugin-framework v1.4.0

Relevant provider source code

Any resource/data source schema will have this problem, sample:

resp.Schema = schema.Schema{
	Attributes: map[string]schema.Attribute{
		"configurable_attribute": schema.StringAttribute{
			MarkdownDescription: "Example configurable attribute",
			Required:            true,
		},
	},
}

Terraform Configuration Files

resource "examplecloud_thing" "this" {
  configurable_attribute = "test"
}

data "examplecloud_thing" "this" {
  configurable_attribute = "test"
}

Expected Behavior

Resource/Data Source type is found and RPCs correctly validate/plan/apply

Actual Behavior

An error diagnostic is returned:

 $ terraform1.6 apply -auto-approve
╷
│ Error: Resource Type Not Found
│ 
│   with examplecloud_thing.this,
│   on resource.tf line 8, in resource "examplecloud_thing" "this":
│    8: resource "examplecloud_thing" "this" {
│ 
│ No resource type named "examplecloud_thing" was found in the provider.
╵
╷
│ Error: Data Source Type Not Found
│ 
│   with data.examplecloud_thing.this,
│   on resource.tf line 12, in data "examplecloud_thing" "this":
│   12: data "examplecloud_thing" "this" {
│ 
│ No data source type named "examplecloud_thing" was found in the provider.
╵

Workarounds

Either of the following will workaround the error

  • For practitioners, they can downgrade to use Terraform 1.5.x

  • For provider developers, they can downgrade terraform-plugin-framework to v1.3.5 AND terraform-plugin-go to v0.18.0.

    • If using terraform-plugin-mux, downgrade to v0.11.2 to avoid build errors from terraform-plugin-go
    • If using terraform-plugin-sdk/v2, downgrade to v2.28.0 to avoid build errors from terraform-plugin-go

Example of build error if you don't downgrade terraform-plugin-go and co.

# github.com/hashicorp/terraform-plugin-framework/internal/proto5server
../../go/pkg/mod/github.com/hashicorp/[email protected]/internal/proto5server/serve.go:14:34: cannot use &Server{} (value of type *Server) as tfprotov5.ProviderServer value in variable declaration: *Server does not implement tfprotov5.ProviderServer (missing method GetMetadata)
# github.com/hashicorp/terraform-plugin-framework/internal/proto6server
../../go/pkg/mod/github.com/hashicorp/[email protected]/internal/proto6server/serve.go:14:34: cannot use &Server{} (value of type *Server) as tfprotov6.ProviderServer value in variable declaration: *Server does not implement tfprotov6.ProviderServer (missing method GetMetadata)

References

@austinvalle austinvalle added the bug Something isn't working label Oct 6, 2023
jSherz added a commit to jSherz/terraform-provider-node-lambda-packager that referenced this issue Oct 8, 2023
jSherz added a commit to jSherz/terraform-provider-node-lambda-packager that referenced this issue Oct 8, 2023
jSherz added a commit to jSherz/terraform-provider-node-lambda-packager that referenced this issue Oct 8, 2023
@austinvalle
Copy link
Member Author

The fix for this issue has been released with terraform-plugin-framework v1.4.1 🚀

Copy link

github-actions bot commented Nov 9, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
1 participant