{"record":{"id":"e86c923d1db7e2ae","repo":"kubernetes/kops","slug":"error-listing-tree-s-v","errorCode":null,"errorMessage":"error listing tree %s: %v","messagePattern":"error listing tree (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/pkg/vfs/gsfs.go","lineNumber":386,"sourceCode":"\t\t}\n\n\t\tclient, err := p.getStorageClient(ctx)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tvar paths []Path\n\t\tit := client.Bucket(p.bucket).Objects(ctx, &storage.Query{Prefix: prefix})\n\t\tfor {\n\t\t\to, err := it.Next()\n\t\t\tif err == iterator.Done {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tif isGCSNotFound(err) {\n\t\t\t\t\treturn true, os.ErrNotExist\n\t\t\t\t}\n\t\t\t\treturn false, fmt.Errorf(\"error listing tree %s: %v\", p, err)\n\t\t\t}\n\t\t\tchild := &GSPath{\n\t\t\t\tvfsContext: p.vfsContext,\n\t\t\t\tbucket:     p.bucket,\n\t\t\t\tkey:        o.Name,\n\t\t\t\tmd5Hash:    base64.StdEncoding.EncodeToString(o.MD5),\n\t\t\t}\n\t\t\tpaths = append(paths, child)\n\t\t}\n\t\tret = paths\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t} else if done {\n\t\treturn ret, nil\n\t} else {\n\t\t// Shouldn't happen - we always return a non-nil error with false","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/util/pkg/vfs/gsfs.go#L368-L404","documentation":"Returned by GSPath.ReadTree when a recursive object listing (no delimiter) fails on it.Next() with an error other than not-found (which is mapped to os.ErrNotExist). It means the GCS list API errored partway through enumerating all objects under the prefix — usually permissions, a dropped connection, or a transient API failure — so the tree of child paths cannot be assembled.","triggerScenarios":"Thrown at util/pkg/vfs/gsfs.go:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify storage.objects.list permission on the bucket for the configured credentials","Retry the listing with backoff; large trees page through many list calls and transient failures are common","Narrow the prefix if the result set exceeds list limits or times out"],"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-12T12:17:11.808Z"}