GoogleContainerTools/skaffold · error

failed to create manifest file

Error message

failed to create manifest file: %w

What it means

Once the manifest is downloaded, downloadFromURL creates a temp file (*.yaml) inside the staging dir with os.CreateTemp. If file creation fails, the error is wrapped as 'failed to create manifest file'.

Solutions

  1. Ensure the staging tmp directory is writable by the current user
  2. Free disk space / check inodes
  3. Check ulimit -n for file-descriptor exhaustion and close leaking handles
Defensive patterns

Strategy: validation

Validate before calling

if st, err := os.Stat(destDir); err != nil || !st.IsDir() {
    return fmt.Errorf("dest dir %q unusable: %w", destDir, err)
}

Try / catch

if err != nil {
    if errors.Is(err, os.ErrPermission) || errors.Is(err, syscall.ENOSPC) {
        // fix permissions / free space, then retry
    }
    return err
}

Prevention

When it happens

Trigger: os.CreateTemp failing in destDir because the directory does not exist (MkdirAll failed silently upstream is not possible — here mostly permission denied, disk full, or too many open files).

Common situations: Read-only or full filesystem; running as non-root in a container without write access to the tmp dir; fd exhaustion in long-running processes.

Related errors


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

Appendix: source

Thrown at pkg/skaffold/kubernetes/manifest/url.go:63

		paths = append(paths, out)
	}
	return paths, nil
}

func downloadFromURL(destDir string, manifest string) (string, error) {
	if manifest == "" || !util.IsURL(manifest) {
		return "", fmt.Errorf("%s is not a valid URL", manifest)
	}

	resp, err := http.Get(manifest)
	if err != nil {
		return "", fmt.Errorf("failed to download manifest from %s, err : %w", manifest, err)
	}
	defer resp.Body.Close()

	f, err := os.CreateTemp(destDir, "*.yaml")
	if err != nil {
		return "", fmt.Errorf("failed to create manifest file: %w", err)
	}
	defer f.Close()
	_, err = io.Copy(f, resp.Body)
	if err != nil {
		return "", fmt.Errorf("failed to write manifest to file, err: %w", err)
	}

	return f.Name(), nil
}

View on GitHub (pinned to a1189de023)