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

Ambiguous provider error message when provider configuration is missing #32784

Closed
Zawadidone opened this issue Mar 6, 2023 · 3 comments
Closed
Labels
bug duplicate issue closed because another issue already tracks this problem

Comments

@Zawadidone
Copy link

Terraform Version

Terraform v1.3.7
on linux_amd64
+ provider registry.terraform.io/dmachard/http-client v0.0.3
+ provider registry.terraform.io/elastic/ec v0.5.1
+ provider registry.terraform.io/elastic/elasticstack v0.5.0
+ provider registry.terraform.io/hashicorp/archive v2.3.0
+ provider registry.terraform.io/hashicorp/google v4.55.0
+ provider registry.terraform.io/hashicorp/google-beta v4.55.0
+ provider registry.terraform.io/hashicorp/null v3.2.1
+ provider registry.terraform.io/hashicorp/random v3.4.3
+ provider registry.terraform.io/hashicorp/template v2.2.0
+ provider registry.terraform.io/hashicorp/vault v3.13.0
+ provider registry.terraform.io/integrations/github v5.18.0
+ provider registry.terraform.io/pagerduty/pagerduty v2.2.1

Your version of Terraform is out of date! The latest version
is 1.3.9. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Configuration Files

terraform {
  required_providers {
    pagerduty = {
        source  = "pagerduty/pagerduty"
        version = "~> 2.2.0"
      }
  }
}

#provider "pagerduty" {
#  token = data.vault_generic_secret.pagerduty.data["api_key"]
#}

data "pagerduty_user" "users" {
  email    = "example@example.com
}

Debug Output

.

Expected Behavior

Terraform should show more context about where the error came from. Preferably the location in the code but at least the relevant provider where the error occured.

For example

╷
│ Error: Missing provider ....
[...]
│ 
│   with provider["registry.terraform.io/pagerduty/pagerduty"],
│   on providers line XXX, in provider "pagerduty":

Actual Behavior

Terraform plan failed because of the not set provider configuration.

│ Error: Missing required argument
│ 
│ The argument "token" is required, but was not set.

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

This also occurs when using the Github provider.

It becomes really hard to debug this error without lacking context.

References

No response

@Zawadidone Zawadidone added bug new new issue not yet triaged labels Mar 6, 2023
@alisdair
Copy link
Contributor

alisdair commented Mar 6, 2023

Hi @Zawadidone! Thanks for reporting this.

This is a duplicate of issue #28482, which contains an explanation and proposed solution. As a result I'm going to close this one.

@alisdair alisdair closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2023
@alisdair alisdair added duplicate issue closed because another issue already tracks this problem and removed new new issue not yet triaged labels Mar 6, 2023
@Zawadidone
Copy link
Author

Okay thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 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 Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug duplicate issue closed because another issue already tracks this problem
Projects
None yet
Development

No branches or pull requests

2 participants