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

google_storage_bucket_object not setting metadata #6256

Closed
iamacleish opened this issue Apr 30, 2020 · 3 comments · Fixed by GoogleCloudPlatform/magic-modules#3458, #6271 or hashicorp/terraform-provider-google-beta#2025
Assignees
Labels

Comments

@iamacleish
Copy link

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.24

Affected Resource(s)

google_storage_bucket_object
metadata
GCS Bucket

Terraform Configuration Files

resource "google_storage_bucket_object" "service-account-key" {
      bucket = "myBucket"
      name = "testobj3"
      content = "This is a test"
      metadata = {
              x-goog-meta-foo: "ddS"
      }

}

Debug Output

2020-04-29T23:30:33.509Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: -----------------------------------------------------
2020-04-29T23:30:33.509Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Retry Transport: Stopping retries, last request was successful
2020-04-29T23:30:33.509Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Retry Transport: Returning after 1 attempts
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Retry Transport: starting RoundTrip retry loop
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Retry Transport: request attempt 0
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Google API Request Details:
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: ---[ REQUEST ]---------------------------------------
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: GET /storage/v1/b/test-321321/o/terraform-1.log?alt=json&prettyPrint=false HTTP/1.1
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Host: www.googleapis.com
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: User-Agent: google-api-go-client/0.5 HashiCorp Terraform/0.12.24 (+https://www.terraform.io) Terraform Plugin SDK/1.4.0 terraform-provider-google/3.19.0
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: X-Goog-Api-Client: gl-go/1.13.4 gdcl/20200302
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Accept-Encoding: gzip
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5:
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5:
2020-04-29T23:30:33.510Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: -----------------------------------------------------
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: 2020/04/29 23:30:33 [DEBUG] Google API Response Details:
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: ---[ RESPONSE ]--------------------------------------
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: HTTP/1.1 200 OK
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Connection: close
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Content-Length: 686
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Cache-Control: private, max-age=0, must-revalidate, no-transform
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Content-Type: application/json; charset=UTF-8
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Date: Wed, 29 Apr 2020 23:30:33 GMT
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Etag: <REDACTED_TOKEN>
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Expires: Wed, 29 Apr 2020 23:30:33 GMT
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Server: UploadServer
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Vary: Origin
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: Vary: X-Origin
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: X-Guploader-Uploadid: <REDACTED_TOKEN>
2020-04-29T23:30:33.618Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5:
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: {
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "kind": "storage#object",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "id": "/terraform-1.log/1588203033425385",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "selfLink": "https://www.googleapis.com/storage/v1/b/test-321321/o/terraform-1.log",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "mediaLink": "https://www.googleapis.com/download/storage/v1/b/test-321321/o/terraform-1.log?generation=1588203033425385&alt=media",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "name": "terraform-1.log",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "bucket": "",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "generation": "1588203033425385",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "metageneration": "1",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "contentType": "text/plain; charset=utf-8",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "storageClass": "STANDARD",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "size": "14",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "md5Hash": "<REDACTED_TOKEN>==",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "crc32c": "2K2UDQ==",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "etag": "COnrja3ljukCEAE=",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "timeCreated": "2020-04-29T23:30:33.425Z",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "updated": "2020-04-29T23:30:33.425Z",
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: "timeStorageClassUpdated": "2020-04-29T23:30:33.425Z"
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: }
2020-04-29T23:30:33.619Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5: -----------------------------------------------------
2020-04-29T23:30:33.620Z [DEBUG] plugin.terraform-provider-google_v3.19.0_x5:

Expected Behavior

Object should be created and metadata should be set.

Actual Behavior

No metadata is set. Object creates with no metadata.

Steps to Reproduce

  1. terraform apply

Important Factoids

I am running this from Cloud Shell as project owner. Gsutil works. Manually setting metadata works. Terraform does not.

  • #0000
@ghost ghost added the bug label Apr 30, 2020
@iamacleish
Copy link
Author

Side note, the debug log doesnt match the code exactly, but changing the values still results in no metadata being set and the same debug logs (just with the right values).

@edwardmedia edwardmedia self-assigned this Apr 30, 2020
@edwardmedia
Copy link
Contributor

I can repro the issue.

@ghost
Copy link

ghost commented Jun 1, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.