{"record":{"id":"9692d8fd283bc32e","repo":"GoogleContainerTools/skaffold","slug":"failed-to-create-the-tmp-directory-w-9692d8","errorCode":null,"errorMessage":"failed to create the tmp directory: %w","messagePattern":"failed to create the tmp directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/kubernetes/manifest/url.go","lineNumber":36,"sourceCode":"\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/util\"\n)\n\nvar ManifestsFromURL = \"manifests_from_url\"\n\n// DownloadFromURL downloads the provided manifests from their URLs,\n// and returns a slice containing downloaded file destinations.\nfunc DownloadFromURL(manifests []string) ([]string, error) {\n\tdir := filepath.Join(ManifestTmpDir, ManifestsFromURL)\n\tif err := os.MkdirAll(dir, os.ModePerm); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create the tmp directory: %w\", err)\n\t}\n\tvar paths []string\n\tfor _, manifest := range manifests {\n\t\tout, err := downloadFromURL(dir, manifest)\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpaths = append(paths, out)\n\t}\n\treturn paths, nil\n}\n\nfunc downloadFromURL(destDir string, manifest string) (string, error) {\n\tif manifest == \"\" || !util.IsURL(manifest) {\n\t\treturn \"\", fmt.Errorf(\"%s is not a valid URL\", manifest)\n\t}\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubernetes/manifest/url.go#L18-L54","documentation":"DownloadFromURL first creates the staging directory <ManifestTmpDir>/manifests-from-url where remote manifests will be written. If os.MkdirAll cannot create it (permission denied, read-only FS, path is a file), the download aborts with this wrapped error.","triggerScenarios":"Calling DownloadFromURL (via resolveRemoteAndLocal) when os.MkdirAll fails on ManifestTmpDir — e.g. tmp dir path exists as a regular file, or the process lacks write permission on the parent directory.","commonSituations":"Running in containers/sandboxes with read-only /tmp or restricted HOME; a leftover file occupying the tmp path from a previous crashed run; disk full.","solutions":["Check and free/fix the tmp directory: ensure the path is not a file (rm the stale file) and the parent is writable","Run the process with a user that has write access to ManifestTmpDir (often under os.TempDir()/HOME)","Fix the environment (writable /tmp, non-readonly rootfs, free disk space) and retry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"dir := filepath.Join(ManifestTmpDir, ManifestsFromURL)\nif st, err := os.Stat(dir); err == nil && !st.IsDir() {\n    return fmt.Errorf(\"%s exists and is not a directory\", dir)\n}\nif err := os.MkdirAll(dir, os.ModePerm); err != nil {\n    return err\n}","typeGuard":null,"tryCatchPattern":"paths, err := manifest.DownloadFromURL(urls)\nif err != nil && strings.Contains(err.Error(), \"failed to create the tmp directory\") {\n    // fix permissions / remove stale file, then retry once\n}","preventionTips":["Ensure TMPDIR/tmp staging paths are writable in your container image","Remove stale files that may occupy the ManifestTmpDir path","Check disk space before large render operations"],"tags":["filesystem","io","manifests","download"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}