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

terraform plan doesn't work after state replace-provider #912

Closed
antigenius0910 opened this issue Sep 23, 2021 · 2 comments
Closed

terraform plan doesn't work after state replace-provider #912

antigenius0910 opened this issue Sep 23, 2021 · 2 comments

Comments

@antigenius0910
Copy link

antigenius0910 commented Sep 23, 2021

Terraform Version

Terraform v1.0.6
on darwin_amd64

  • provider registry.terraform.io/hashicorp/github v4.15.0
  • provider registry.terraform.io/integrations/github v4.15.0

Affected Resource(s)

  • repositories

Terraform Configuration Files

% cat repository.tf 
resource "github_repository" "tfer--test1" {
  allow_merge_commit     = "false"
  allow_rebase_merge     = "true"
  allow_squash_merge     = "true"
  archived               = "false"
  default_branch         = "main"
  delete_branch_on_merge = "false"
  has_downloads          = "true"
  has_issues             = "true"
  has_projects           = "true"
  has_wiki               = "true"
  is_template            = "false"
  name                   = "test1"
  visibility             = "private"
  vulnerability_alerts   = "false"
}

 % cat provider.tf  
provider "github" {
  owner = "teleport-yen"
}

terraform {
	required_providers {
		github = {
      source  = "integrations/github"
	    version = "~> 4.15.0"
		}
  }
}

Debug Output

https://gist.githubusercontent.com/antigenius0910/a7843b5ff384e32834bea64c8175867f/raw/6b9a1f098af8986801e7bc1576b81412e0bc3a73/gistfile1.txt

Expected Behavior

should return something like below

 % terraform plan 
github_repository_collaborator.tfer--test2-003A-antigenius0910: Refreshing state... [id=test2:antigenius0910]
github_repository_collaborator.tfer--test3-003A-antigenius0910: Refreshing state... [id=test3:antigenius0910]
github_repository.tfer--test1: Refreshing state... [id=test1]
github_repository_collaborator.tfer--test1-003A-antigenius0910: Refreshing state... [id=test1:antigenius0910]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
╷
│ Warning: "default_branch": [DEPRECATED] Use the github_branch_default resource instead
│ 
│   with github_repository.tfer--test1,
│   on repository.tf line 1, in resource "github_repository" "tfer--test1":
│    1: resource "github_repository" "tfer--test1" {
│ 
│ (and one more similar warning elsewhere)
╵

Actual Behavior

2021-09-23T12:59:57.092-0500 [DEBUG] No provider meta schema returned
╷
│ Error: Internal validation of the provider failed! This is always a bug
│ with the provider itself, and not a user issue. Please report
│ this bug:
│ 
│ 1 error occurred:
│ 	* resource github_repository: etag: DiffSuppressFunc is for suppressing differences between config and state representation. There is no config for computed-only field, nothing to compare.
│ 
│ 
│ 
│   with provider["registry.terraform.io/integrations/github"],
│   on provider.tf line 1, in provider "github":
│    1: provider "github" {
│ 
╵
2021-09-23T12:59:57.102-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/integrations/github/4.15.0/darwin_amd64/terraform-provider-github_v4.15.0 pid=33133
2021-09-23T12:59:57.102-0500 [DEBUG] provider: plugin exited

Steps to Reproduce

% terraform init   

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of integrations/github from the dependency lock file
- Using previously-installed integrations/github v4.15.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

% terraform plan
╷
│ Error: Internal validation of the provider failed! This is always a bug
│ with the provider itself, and not a user issue. Please report
│ this bug:
│ 
│ 1 error occurred:
│ 	* resource github_repository: etag: DiffSuppressFunc is for suppressing differences between config and state representation. There is no config for computed-only field, nothing to compare.
│ 
│ 
│ 
│   with provider["registry.terraform.io/integrations/github"],
│   on provider.tf line 1, in provider "github":
│    1: provider "github" {

Important Factoids

Screen Shot 2021-09-23 at 2 14 06 PM

References

resource were pulled from terraformer
https://github.com/GoogleCloudPlatform/terraformer/blob/master/docs/github.md
https://marcqualie.com/2021/05/upgrading-legacy-terraform-providers

@antigenius0910
Copy link
Author

duplicate with #910

@antigenius0910
Copy link
Author

change from 4.15.0 to 4.14.0 works

% cat provider.tf 
provider "github" {
  owner = "teleport-yen"
}

terraform {
	required_providers {
		github = {
      source  = "integrations/github"
	    version = "~> 4.14.0"
		}
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant