kubernetes/kops · error

invalid path in swiftfs tree: %s

Error message

invalid path in swiftfs tree: %s

What it means

Internal type guard in SwiftPath.RemoveAll: the paths returned by ReadTree must all be *SwiftPath, but one entry is a different Path implementation. This indicates the tree listing was somehow mixed with another VFS backend — a programming invariant violation rather than a runtime condition — so the bulk-delete keys cannot be extracted and the purge aborts.

Source

Thrown at util/pkg/vfs/swiftfs.go:328

		return err
	} else if done {
		return nil
	} else {
		return wait.ErrWaitTimeout
	}
}

func (p *SwiftPath) RemoveAll(ctx context.Context) error {
	tree, err := p.ReadTree(ctx)
	if err != nil {
		return err
	}

	objects := make([]string, len(tree))
	for i := range tree {
		swiftObject, isSwiftObject := tree[i].(*SwiftPath)
		if !isSwiftObject {
			return fmt.Errorf("invalid path in swiftfs tree: %s", tree[i].Path())
		}
		objects[i] = swiftObject.key
	}

	objectsToDelete := []string(nil)
	for len(objects) > 0 {
		// BulkDelete can only process 10000 objects per call
		if len(objects) > 10000 {
			objectsToDelete = objects[:10000]
			objects = objects[10000:]
		} else {
			objectsToDelete = objects
			objects = nil
		}

		done, err := RetryWithBackoff(swiftWriteBackoff, func() (bool, error) {
			client, err := p.getClient(ctx)
			if err != nil {

View on GitHub (pinned to 4c8573c808)

Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at util/pkg/vfs/swiftfs.go:328 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/082c4420aa8e4385. Report an issue: GitHub.