{"record":{"id":"c90607a6ba84fcd4","repo":"kubernetes/kops","slug":"error-listing-children-of-s-v","errorCode":null,"errorMessage":"error listing children of %s: %v","messagePattern":"error listing children of (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/vfsclientset/utils.go","lineNumber":33,"sourceCode":"*/\n\npackage vfsclientset\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"k8s.io/kops/util/pkg/vfs\"\n)\n\nfunc listChildNames(ctx context.Context, vfsPath vfs.Path) ([]string, error) {\n\tchildren, err := vfsPath.ReadDir()\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error listing children of %s: %v\", vfsPath, err)\n\t}\n\n\tvar names []string\n\tfor _, child := range children {\n\t\tnames = append(names, child.Base())\n\t}\n\treturn names, nil\n}\n","sourceCodeStart":15,"sourceCodeEnd":42,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/vfsclientset/utils.go#L15-L42","documentation":"listChildNames enumerates the directory entries of a VFS path to build a name list. If ReadDir fails with an error other than os.IsNotExist (which is treated as an empty list), it wraps the underlying error with the path. This is a wrapper: the real cause (permissions, network, backend failure) is in %v.","triggerScenarios":"Calling listNames (e.g. listing instance groups or clusters) where the state-store path exists at the backend level but ReadDir fails: credentials revoked, S3 throttling, network partition, or the path being a file rather than a directory.","commonSituations":"Expired/misconfigured cloud credentials when listing a state store; S3 bucket policy changes; transient AWS/GCS API outages during kops get/list operations.","solutions":["Inspect the wrapped %v cause and fix the underlying VFS backend issue (credentials, permissions, network).","Retry the list operation if the cause is transient (throttling/5xx).","Verify the state-store path is a directory-like prefix and the VFS context is configured with the correct flags."],"exampleFix":"// before\nnames, err := listChildNames(ctx, path) // opaque failure\n// after\nnames, err := listChildNames(ctx, path)\nif err != nil {\n  klog.V(2).Infof(\"listing %s failed: %v; check credentials and bucket permissions\", path, err)\n  return err\n}","handlingStrategy":"retry","validationCode":"// verify access before listing\nif _, err := path.ReadDir(); err != nil && !os.IsNotExist(err) {\n  return fmt.Errorf(\"state store %s not accessible: %v\", path, err)\n}","typeGuard":null,"tryCatchPattern":"names, err := listChildNames(ctx, p)\nif err != nil {\n  var retryable = isTransient(err) // throttling, 5xx, net timeout\n  if retryable { return retryWithBackoff(func() ([]string, error) { return listChildNames(ctx, p) }) }\n  return err\n}","preventionTips":["Validate cloud credentials before VFS operations.","Handle os.IsNotExist as an empty result, everything else as retryable or fatal.","Check bucket/prefix permissions when provisioning new state stores."],"tags":["vfs","list","io","state-store"],"backgroundTag":"vfs-backend-read-failure","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"}