{"record":{"id":"9e94b2b39923fd02","repo":"kubernetes/kops","slug":"error-reading-s-v-9e94b2","errorCode":null,"errorMessage":"error reading %s: %v","messagePattern":"error reading (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/gsfs.go","lineNumber":298,"sourceCode":"\tctx := context.TODO()\n\treturn p.WriteToWithContext(ctx, out)\n}\n\n// WriteToWithContext implements io.WriterTo, but adds a context\nfunc (p *GSPath) WriteToWithContext(ctx context.Context, out io.Writer) (int64, error) {\n\tklog.V(4).Infof(\"Reading file %q\", p)\n\n\tclient, err := p.getStorageClient(ctx)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tr, err := client.Bucket(p.bucket).Object(p.key).NewReader(ctx)\n\tif err != nil {\n\t\tif isGCSNotFound(err) {\n\t\t\treturn 0, os.ErrNotExist\n\t\t}\n\t\treturn 0, fmt.Errorf(\"error reading %s: %v\", p, err)\n\t}\n\tdefer r.Close()\n\n\treturn io.Copy(out, r)\n}\n\n// ReadDir implements Path::ReadDir\nfunc (p *GSPath) ReadDir() ([]Path, error) {\n\tctx := context.TODO()\n\n\tvar ret []Path\n\tdone, err := RetryWithBackoff(gcsReadBackoff, func() (bool, error) {\n\t\tprefix := p.key\n\t\tif !strings.HasSuffix(prefix, \"/\") {\n\t\t\tprefix += \"/\"\n\t\t}\n\n\t\tclient, err := p.getStorageClient(ctx)","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/gsfs.go#L280-L316","documentation":"Returned by GSPath.WriteToWithContext when opening a GCS object reader fails for a reason other than not-found (not-found is mapped to os.ErrNotExist first). It means the object exists check/reader creation errored — typically permission denied on the bucket, transient API failure, or an invalid bucket/key — while streaming the object's contents to the caller.","triggerScenarios":"Thrown at util/pkg/vfs/gsfs.go:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect credentials and verify the account has storage.objects.get permission on the bucket","Confirm the bucket name and object key are correct and the bucket is in an accessible project","Retry on transient Google API errors; the GCS SDK surfaces 5xx and rate-limit errors that clear on backoff"],"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"}