{"record":{"id":"fe4e344c45f44d29","repo":"kubernetes/kops","slug":"rendering-gcs-file-v","errorCode":null,"errorMessage":"rendering GCS file: %v","messagePattern":"rendering GCS file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/gsfs.go","lineNumber":496,"sourceCode":"type terraformGSObjectAccessControl struct {\n\tBucket     string                   `json:\"bucket\" cty:\"bucket\"`\n\tObject     *terraformWriter.Literal `json:\"object\" cty:\"object\"`\n\tRoleEntity []string                 `json:\"role_entity\" cty:\"role_entity\"`\n\tProvider   *terraformWriter.Literal `json:\"provider,omitempty\" cty:\"provider\"`\n}\n\nfunc (p *GSPath) RenderTerraform(w *terraformWriter.TerraformWriter, name string, data io.Reader, acl ACL) error {\n\tbytes, err := io.ReadAll(data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading data: %v\", err)\n\t}\n\n\ttfProviderArguments := map[string]string{} // GCS doesn't need the project and region specified\n\tw.EnsureTerraformProvider(\"google\", tfProviderArguments)\n\n\tcontent, err := w.AddFilePath(\"google_storage_bucket_object\", name, \"content\", bytes, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"rendering GCS file: %v\", err)\n\t}\n\n\ttf := &terraformGSObject{\n\t\tBucket:   p.Bucket(),\n\t\tName:     p.Object(),\n\t\tSource:   content,\n\t\tProvider: terraformWriter.LiteralTokens(\"google\", \"files\"),\n\t}\n\terr = w.RenderResource(\"google_storage_bucket_object\", name, tf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// file ACLs can be empty on GCP, because of a bucket-only ACL.\n\tif acl != nil {\n\t\ttfACL := &terraformGSObjectAccessControl{\n\t\t\tBucket:     p.Bucket(),\n\t\t\tObject:     p.TerraformLink(name),","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/gsfs.go#L478-L514","documentation":"Returned by GSPath.RenderTerraform when the TerraformWriter fails while emitting the google_storage_object resource for this path — e.g. a file name conflict in the writer, an invalid resource name, or an I/O error writing the .tf output. It is a guard on the writer step after the data has been successfully read.","triggerScenarios":"Thrown at util/pkg/vfs/gsfs.go:496 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying writer error: duplicate resource names usually mean the same path is rendered twice with one name","Ensure the destination Terraform output is writable","Fix or deduplicate the resource name passed to RenderTerraform"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}