kubernetes/kops · error
reading data: %v
Error message
reading data: %v
What it means
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.
Source
Thrown at util/pkg/vfs/gsfs.go:488
type terraformGSObject struct {
Bucket string `json:"bucket" cty:"bucket"`
Name string `json:"name" cty:"name"`
Source *terraformWriter.Literal `json:"source" cty:"source"`
Provider *terraformWriter.Literal `json:"provider,omitempty" cty:"provider"`
}
type terraformGSObjectAccessControl struct {
Bucket string `json:"bucket" cty:"bucket"`
Object *terraformWriter.Literal `json:"object" cty:"object"`
RoleEntity []string `json:"role_entity" cty:"role_entity"`
Provider *terraformWriter.Literal `json:"provider,omitempty" cty:"provider"`
}
func (p *GSPath) RenderTerraform(w *terraformWriter.TerraformWriter, name string, data io.Reader, acl ACL) error {
bytes, err := io.ReadAll(data)
if err != nil {
return fmt.Errorf("reading data: %v", err)
}
tfProviderArguments := map[string]string{} // GCS doesn't need the project and region specified
w.EnsureTerraformProvider("google", tfProviderArguments)
content, err := w.AddFilePath("google_storage_bucket_object", name, "content", bytes, false)
if err != nil {
return fmt.Errorf("rendering GCS file: %v", err)
}
tf := &terraformGSObject{
Bucket: p.Bucket(),
Name: p.Object(),
Source: content,
Provider: terraformWriter.LiteralTokens("google", "files"),
}
err = w.RenderResource("google_storage_bucket_object", name, tf)
if err != nil {View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at util/pkg/vfs/gsfs.go:488 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/1fc03e17c9a02f36.
Report an issue: GitHub.