kubernetes/kops · error
error deleting %s configuration %q: %v
Error message
error deleting %s configuration %q: %v
What it means
delete() removes the configuration file for a named object from the VFS state store. NotExist is treated as success; any other Remove error is wrapped with this message including kind and name. It means the state-store could not perform the deletion.
Source
Thrown at pkg/client/simple/vfsclientset/commonvfs.go:212
objectMeta.SetCreationTimestamp(metav1.NewTime(time.Now().UTC()))
}
err = c.writeConfig(ctx, cluster, c.basePath.Join(objectMeta.GetName()), i, vfs.WriteOptionOnlyIfExists)
if err != nil {
return fmt.Errorf("error writing %s: %v", c.kind, err)
}
return nil
}
func (c *VFSClientBase) delete(ctx context.Context, name string, options metav1.DeleteOptions) error {
p := c.basePath.Join(name)
err := p.Remove(ctx)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return fmt.Errorf("error deleting %s configuration %q: %v", c.kind, name, err)
}
return nil
}
func (c *VFSClientBase) listNames(ctx context.Context) ([]string, error) {
keys, err := listChildNames(ctx, c.basePath)
if err != nil {
return nil, fmt.Errorf("error listing %s in state store: %v", c.kind, err)
}
// Seems to be an assumption in k8s APIs that items are always returned sorted
sort.Strings(keys)
return keys, nil
}
func (c *VFSClientBase) readAll(ctx context.Context, items interface{}) (interface{}, error) {
sliceValue := reflect.ValueOf(items)View on GitHub (pinned to 4c8573c808)
Solutions
- Inspect the wrapped %v error and fix backend permissions or connectivity.
- Check IAM policy allows DeleteObject on the state bucket.
- Retry after transient errors (throttling, network).
- Verify the name/kind matches the actually stored object.
Example fix
// before policy with only s3:GetObject,s3:PutObject // after policy actions ["s3:GetObject","s3:PutObject","s3:DeleteObject"] on arn:aws:s3:::my-state-bucket/*
Defensive patterns
Strategy: retry
Validate before calling
names, err := listChildNames(ctx, basePath)
if err != nil {
return fmt.Errorf("cannot list state store before delete: %w", err)
}
// confirm target exists before deleting Try / catch
if err := client.Delete(ctx, name, metav1.DeleteOptions{}); err != nil {
if strings.Contains(err.Error(), "error deleting") && isTransient(err) {
return retryWithBackoff(func() error { return client.Delete(ctx, name, metav1.DeleteOptions{}) })
}
return err
} // NotExist is already treated as success by the library Prevention
- Grant s3:DeleteObject (or equivalent) on the state bucket
- Account for bucket versioning/retention policies
- Retry throttled deletes with backoff
When it happens
Trigger: DeleteAutoScalingGroup / ReleaseAddress / DeleteDhcpOptions / DeleteEgressOnlyInternetGateway / DeleteInternetGateway / DeleteKeyPair call delete() and vfs Remove fails with permission-denied, network error, or backend failure.
Common situations: Credentials lacking s3:DeleteObject, bucket versioning/retention policies blocking deletes, API throttling, network outage during teardown (`kops delete cluster`).
Related errors
- reading file %q: %v
- error reading full cluster spec for %q: %v
- reading kops-channels manifest %s: %w
- error parsing ConfigStore.Base %q: %v
- error reading state store: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/660a1acb9c4ac53b.
Report an issue: GitHub.