GoogleContainerTools/skaffold · error

temporary file system operation is out of boundary, root: %s

Error message

temporary file system operation is out of boundary, root: %s, trying to access %s

What it means

TmpFSReal is a sandboxed in-memory temp filesystem used by the kustomize renderer; validate() ensures every path it touches is the root itself or underneath root (prefix root+"/"). Any access outside that boundary returns this error, protecting against kustomize reading or writing files outside the generated tmp tree.

Source

Thrown at pkg/skaffold/render/renderer/kustomize/fs.go:66

		root: filepath.Clean(rootPath),
	}
}

func (f TmpFSReal) Cleanup() {
	os.RemoveAll(f.root)
}

func (f TmpFSReal) GetPath(path string) (string, error) {
	res := filepath.Join(f.root, path)
	if err := f.validate(res); err != nil {
		return "", err
	}
	return res, nil
}

func (f TmpFSReal) validate(path string) error {
	if path != f.root && !strings.HasPrefix(path, f.root+"/") {
		return fmt.Errorf("temporary file system operation is out of boundary, root: %s, trying to access %s", f.root, path)
	}
	return nil
}

type TmpFS interface {
	WriteTo(path string, content []byte) error
	Cleanup()
	GetPath(path string) (string, error)
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Remove resource references that escape the kustomization dir (../ or absolute paths)
  2. Set loadRestrictions: NobodyCanLoad from outside the kustomization root so kustomize errors locally instead of escaping the tmp FS
  3. Check for symlinks in your kustomize tree pointing outside the project and replace them with real files
  4. Ensure all referenced bases/resources are inside the kustomization directory so Skaffold copies them into the tmp FS

Example fix

# before
resources:
  - ../../shared/base
# after: copy or vendor the base under the project, or use a kustomize remote base
resources:
  - ./base
Defensive patterns

Strategy: validation

Validate before calling

grep -rE '(\.\./|/[a-z]+/)' kustomization.yaml */kustomization.yaml && echo 'paths may escape kustomization root'

Try / catch

p, err := tmpFS.GetPath(name)
if err != nil && strings.Contains(err.Error(), "out of boundary") {
    // the referenced resource lives outside the kustomize tmp root; fix the reference
}

Prevention

When it happens

Trigger: GetPath (via validate) is asked for a path that is not equal to f.root and doesn't start with f.root+"/" — e.g. kustomize resolves a resource/loadRestriction to an absolute path outside the temp root, or a symlinked/normalized path escapes the root.

Common situations: Kustomization referencing resources via ../ relative paths that escape the tmp root; absolute file paths in resources while loadRestrictions allow them; symlinks inside the tmp dir pointing outside; Skaffold failing to mirror a referenced file into the tmp FS.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/66771f645074935a. Report an issue: GitHub.