{"record":{"id":"1fc03e17c9a02f36","repo":"kubernetes/kops","slug":"reading-data-v","errorCode":null,"errorMessage":"reading data: %v","messagePattern":"reading data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/gsfs.go","lineNumber":488,"sourceCode":"\ntype terraformGSObject struct {\n\tBucket   string                   `json:\"bucket\" cty:\"bucket\"`\n\tName     string                   `json:\"name\" cty:\"name\"`\n\tSource   *terraformWriter.Literal `json:\"source\" cty:\"source\"`\n\tProvider *terraformWriter.Literal `json:\"provider,omitempty\" cty:\"provider\"`\n}\n\ntype 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 {","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/gsfs.go#L470-L506","documentation":"Returned by GSPath.RenderTerraform when io.ReadAll fails while slurping the file data to embed in Terraform output. The reader itself is faulty (network stream dropped, reader already consumed and unreadable, or closed) — the GCS path is not involved; only the in-memory data stream is at fault.","triggerScenarios":"Thrown at util/pkg/vfs/gsfs.go:488 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the supplied io.Reader is open and positioned at the start before calling RenderTerraform","If the reader wraps a network stream, re-fetch the data and retry the render","Wrap or replace the reader with a bytes.Reader when the content is already in memory"],"exampleFix":null,"handlingStrategy":"retry","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"}