# Terraform provider plugin tutorial invalid data source

**URL:** <https://discuss.hashicorp.com/t/terraform-provider-plugin-tutorial-invalid-data-source/62750>\
**Category:** Plugin Development\
**Created:** [February 13, 2024, 9:02pm UTC](https://discuss.hashicorp.com/t/terraform-provider-plugin-tutorial-invalid-data-source/62750 "2024-02-13T21:02:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwolfehcm](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/bwolfehcm/32/40322_2.png) [@bwolfehcm](https://discuss.hashicorp.com/u/bwolfehcm)\
**Post date:** [February 13, 2024, 9:02pm UTC](https://discuss.hashicorp.com/t/terraform-provider-plugin-tutorial-invalid-data-source/62750/1 "2024-02-13T21:02:56Z")

</div>

Hi I am going through the terraform provider tutorial. I made it to the section where you make a temporary Data Source. but I keep getting the following from running the terraform plan command.

```auto
[vagrant@terraform-tutorial provider-install-verification]$ terraform plan
╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│ - hashicorp.com/edu/hashicups in /home/vagrant/golang/go/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become
│ incompatible with published releases.
╵
╷
│ Error: Invalid data source
│
│ on main.tf line 11, in data "hashicups_coffees" "example":
│ 11: data "hashicups_coffees" "example" {}
│
│ The provider hashicorp.com/edu/hashicups does not support data source "hashicups_coffees".
╵
[vagrant@terraform-tutorial provider-install-verification]$

```

as far as I can tell I followed the tutorial correctly. but its not finding the datasource. Is there a way to debug this?

---

<div class="post-metadata">

**Author:** ![bendbennett](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/bendbennett/32/30764_2.png) [@bendbennett](https://discuss.hashicorp.com/u/bendbennett)\
**Post date:** [February 14, 2024, 9:40am UTC](https://discuss.hashicorp.com/t/terraform-provider-plugin-tutorial-invalid-data-source/62750/2 "2024-02-14T09:40:32Z")

</div>

Hi @bwolfehcm 👋

Are you referring to this step [Configure provider client | Terraform | HashiCorp Developer](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider-configure#verify-provider-configuration)?

Without seeing the code that you have in place, it’s a little difficult to be sure, but I think the most likely explanation is that you may not have set-up the `DataSources` within `provider.go`:

```auto
func (p *hashicupsProvider) DataSources(_ context.Context) []func() datasource.DataSource {
	return []func() datasource.DataSource{
		NewCoffeesDataSource,
	}
}

```

Implementation of the temporary data source itself is described in the previous step - [Configure provider client | Terraform | HashiCorp Developer](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework/providers-plugin-framework-provider-configure#implement-temporary-data-source).

You can debug the provider by starting it in debug mode - [Plugin Development - Debugging Providers | Terraform | HashiCorp Developer](https://developer.hashicorp.com/terraform/plugin/debugging#starting-a-provider-in-debug-mode)

I’m using GoLand, so I typically set-up debugging as follows:

 ![image](https://global.discourse-cdn.com/hashicorp/original/3X/a/7/a7f8afd85d0f467c7ade83f292749b9bdccc7ddd.jpeg)

Starting a debug session, will then output something like the following:

```auto
TF_REATTACH_PROVIDERS='{"hashicorp.com/edu/hashicups":{"Protocol":"grpc","ProtocolVersion":6,"Pid":28092,"Test":true,"Addr":{"Network":"unix","String":"/var/folders/23/p8tx31c53rd16t1pjt03zndc0000gq/T/plugin1868715239"}}}'

```

You can then execute:

```auto
export TF_REATTACH_PROVIDERS='{"hash..............

```

Then you can set break points and run _terraform plan_.

---

<div class="post-metadata">

**Author:** ![bwolfehcm](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/bwolfehcm/32/40322_2.png) [@bwolfehcm](https://discuss.hashicorp.com/u/bwolfehcm)\
**Post date:** [February 16, 2024, 2:29am UTC](https://discuss.hashicorp.com/t/terraform-provider-plugin-tutorial-invalid-data-source/62750/3 "2024-02-16T02:29:59Z")

</div>

ok interesting. for some reason running the debug in goland reset the terraform process. Its working now.  
i’m not sure what I did to fix it, but my code was correct. I guess the older version got cached or something.  
I ended up deleteing the terraform-provider-hashicups binary which gets put in the golang/go/bin directory and reran the “go install .” command

So maybe it forced it to update the binary file.

After that I was running into some schema loading issue.

```auto
Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider
│ schema: Could not load the schema for provider hashicorp.com/edu/hashicups:
│ failed to instantiate provider "hashicorp.com/edu/hashicups" to obtain
│ schema: Reattachment process not found..

```

I had to unset the TF\_REATTACH\_PROVIDERS variable for it to load the schema in the regular terraform commandline process.

I did find that setting TF\_LOG=DEBUG environment variable was helpful as well.
