kubernetes/kops · error
error listing children of %s: %v
Error message
error listing children of %s: %v
What it means
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.
Source
Thrown at pkg/client/simple/vfsclientset/utils.go:33
*/
package vfsclientset
import (
"context"
"fmt"
"os"
"k8s.io/kops/util/pkg/vfs"
)
func listChildNames(ctx context.Context, vfsPath vfs.Path) ([]string, error) {
children, err := vfsPath.ReadDir()
if err != nil {
if os.IsNotExist(err) {
return nil, nil
}
return nil, fmt.Errorf("error listing children of %s: %v", vfsPath, err)
}
var names []string
for _, child := range children {
names = append(names, child.Base())
}
return names, nil
}
View on GitHub (pinned to 4c8573c808)
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.
Example fix
// before
names, err := listChildNames(ctx, path) // opaque failure
// after
names, err := listChildNames(ctx, path)
if err != nil {
klog.V(2).Infof("listing %s failed: %v; check credentials and bucket permissions", path, err)
return err
} Defensive patterns
Strategy: retry
Validate before calling
// verify access before listing
if _, err := path.ReadDir(); err != nil && !os.IsNotExist(err) {
return fmt.Errorf("state store %s not accessible: %v", path, err)
} Try / catch
names, err := listChildNames(ctx, p)
if err != nil {
var retryable = isTransient(err) // throttling, 5xx, net timeout
if retryable { return retryWithBackoff(func() ([]string, error) { return listChildNames(ctx, p) }) }
return err
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Expired/misconfigured cloud credentials when listing a state store; S3 bucket policy changes; transient AWS/GCS API outages during kops get/list operations.
Related errors
- error listing %s in state store: %v
- reading existing keyset: %v
- error reading full cluster spec for %q: %v
- error listing Keysets: %v
- listing keysets: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/c90607a6ba84fcd4.
Report an issue: GitHub.