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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.20.0 breaking google_bigquery_table expected specifier? #4919

Closed
sgringwe opened this issue Nov 15, 2019 · 9 comments 路 Fixed by GoogleCloudPlatform/magic-modules#2760
Closed
Assignees
Labels
bug

Comments

@sgringwe
Copy link

@sgringwe sgringwe commented Nov 15, 2019

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Terraform Version

Terraform v0.12.13

Affected Resource(s)

  • google_bigquery_table

Terraform Configuration Files

resource "google_bigquery_table" "activities_table" {
  dataset_id = "${google_bigquery_dataset.activities_dataset.dataset_id}"
  table_id   = "activities"

  schema = <<EOF
[
  {
    "description": "id",
    "name": "id",
    "type": "INTEGER",
    "mode": "NULLABLE"
  }
]
EOF
}

Debug Output

Output from plan command:

Invalid BigQuery table specifier. Expecting projects/{{project}}/datasets/{{dataset}}/tables/{{table}}, got project-staging:activities.activities

Panic Output

Expected Behavior

In this case, I am changing unrelated features and the tables haven't changed on the infrastruture. I would expect for it to continue with the plan and not error on reading the bigquery table state.

Actual Behavior

The plan process fails with the above output.

Steps to Reproduce

  1. Have an existing terraform state with a bigquery table resource
  2. Run terraform plan

Important Factoids

If version 2.19.0 is specified, it does not error. Perhaps related to 2.20.0 release?

This plan command is failing on a state file with existing table resources. The changes in the new plan are unrelated.

References

@hashibot hashibot bot added the bug label Nov 15, 2019
@sgringwe sgringwe changed the title Terraform plan unexpectedly expecting different google_bigquery_table specifier Version 2.20.0 breaking google_bigquery_table expected specifier? Nov 15, 2019
@sgringwe

This comment has been minimized.

@rileykarson rileykarson self-assigned this Nov 15, 2019
@rileykarson

This comment has been minimized.

Copy link
Collaborator

@rileykarson rileykarson commented Nov 15, 2019

Can you confirm your provider version is 2.20.0 and not 3.0.0-beta.1?

@KimRomBot

This comment has been minimized.

Copy link

@KimRomBot KimRomBot commented Nov 20, 2019

I am getting this error now as well without having changed any configuration at all (all I did was change source code that some Cloud Functions are using and the BigQuery resources aren鈥檛 a part of that). Where is the above code being referenced/called in Terraform Plan?

@hashibot hashibot bot removed the waiting-response label Nov 20, 2019
@rileykarson

This comment has been minimized.

Copy link
Collaborator

@rileykarson rileykarson commented Nov 20, 2019

@KimRomBot can you also confirm your version?

@KimRomBot

This comment has been minimized.

Copy link

@KimRomBot KimRomBot commented Nov 21, 2019

@rileykarson

Terraform v0.12.16
provider.archive v1.3.0
provider.google v3.0.0-beta.1

So it is indeed 3.0.0-beta.1! Is there any way to tell Terraform to use the latest stable version?

@hashibot hashibot bot removed the waiting-response label Nov 21, 2019
@rileykarson

This comment has been minimized.

Copy link
Collaborator

@rileykarson rileykarson commented Nov 21, 2019

I'd recommend using version restraints to pin to a specific release / release series as shown in https://www.terraform.io/docs/providers/google/guides/version_3_upgrade.html#provider-version-configuration.

I believe this would lock you to the 2.X series:

provider "google" {
  # ... other configuration ...

  version = "~> 2.0"
}

It may not be possible to revert, since going from 2.X -> 3.X could have modified statefiles in incompatible ways. Regardless, this paragraph contains instructions on how. For what it's worth, 3.0.0-beta.1 is a fairly complete version of 3.0.0.

@olegkorol

This comment has been minimized.

Copy link

@olegkorol olegkorol commented Nov 27, 2019

I had the same issue and can confirm that pinning the provider's version to 2.X (e.g. 2.16.0) solves the problem.

The new version v3.0.0-beta.1 seems to have a bug.

@hashibot hashibot bot removed the waiting-response label Nov 27, 2019
@rileykarson

This comment has been minimized.

Copy link
Collaborator

@rileykarson rileykarson commented Nov 27, 2019

Thanks for confirming the version! It looks like we didn't catch that this resource relies directly on the id value, which isn't true of most resources anymore. Changing the format ended up being incompatible, but not in a way that our tests caught.

I'm working on a fix, I'll try to get it in for the 3.0.0 release ~Tuesday. If it misses that, it should land in 3.1.0 ~Thursday next.

@rileykarson

This comment has been minimized.

Copy link
Collaborator

@rileykarson rileykarson commented Dec 2, 2019

This should work again in 3.1.0, I missed the cutoff for 3.0.0 by a day. Sorry for the breakage! 3.1.0 should be later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.