{"record":{"id":"780c6da3abcac35f","repo":"GoogleContainerTools/skaffold","slug":"failed-to-create-the-tmp-directory-w","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/helm/args.go","lineNumber":106,"sourceCode":"\t\t// hack required when using new Skaffold v2.X.Y setValueTemplates w/ Skaffold v1.X.Y \"imageStrategy: helm\"\n\t\t// ex: image: \"{{.Values.image.repository}}:{{.Values.image.tag}}\"\n\t\t// when the helm template replacements are done with `dev` and `run` there\n\t\t// is an additional `@` suffix inserted that needs to be removed or else deploys will fail\n\t\tv = strings.TrimSuffix(v, \"@\")\n\n\t\targs = append(args, \"--set\", fmt.Sprintf(\"%s=%s\", expandedKey, v))\n\t}\n\n\tgcs := gcs.NewGsutil()\n\n\tfor _, v := range r.ValuesFiles {\n\t\ttempValueFile := v\n\n\t\t// if the file starts with gs:// then download it in tmp dir\n\t\tif strings.HasPrefix(v, gcsPrefix) {\n\t\t\ttempDir, err := os.MkdirTemp(\"\", valueFileFromGCS)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to create the tmp directory: %w\", err)\n\t\t\t}\n\n\t\t\tif extractedFilePath, err := extractValueFileFromGCS(v, tempDir, gcs); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t} else {\n\t\t\t\ttempValueFile = extractedFilePath\n\t\t\t}\n\t\t}\n\n\t\texp, err := homedir.Expand(tempValueFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to expand %q: %w\", v, err)\n\t\t}\n\n\t\texp, err = util.ExpandEnvTemplate(exp, envMap)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/helm/args.go#L88-L124","documentation":"ConstructOverrideArgs handles helm values files that start with `gs://` by downloading them into a temporary directory via extractValueFileFromGCS. Before that it calls os.MkdirTemp; if the OS refuses to create the temp dir, this error is wrapped and the whole override-args construction aborts.","triggerScenarios":"Calling ConstructOverrideArgs with a values file path starting with `gs://` (gcsPrefix) while os.MkdirTemp(\"\", valueFileFromGCS) fails — no writable TMPDIR, disk full, or overly restrictive permissions.","commonSituations":"CI containers with read-only /tmp or unwritable TMPDIR; disk-quota exhaustion on the build machine; custom TMPDIR pointing at a non-existent directory; using GCS-hosted helm values files in sandboxed runners.","solutions":["Ensure TMPDIR points to a writable directory, or unset a broken TMPDIR so /tmp is used.","Free disk space if the filesystem is full (`df -h`).","Fix permissions on the temp directory location for the user running Skaffold.","As a workaround, download the GCS values file yourself and reference the local path in the helm config."],"exampleFix":"// before (CI with read-only tmp)\nTMPDIR=/nonexistent skaffold deploy\n// after\nexport TMPDIR=/home/ci/tmp && mkdir -p $TMPDIR && skaffold deploy","handlingStrategy":"validation","validationCode":"if strings.HasPrefix(valuesPath, \"gs://\") {\n\ttmp := os.TempDir()\n\tif fi, err := os.Stat(tmp); err != nil || !fi.IsDir() {\n\t\tf, err := os.CreateTemp(tmp, \"skaffold-probe\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"temp dir %s not writable: %w\", tmp, err)\n\t\t}\n\t\tf.Close(); os.Remove(f.Name())\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify TMPDIR is writable in CI before runs that fetch GCS values files","Monitor disk space on build machines","Pre-download GCS values files locally as a fallback","Avoid read-only root filesystems for Skaffold containers"],"tags":["helm","filesystem","gcs"],"backgroundTag":"temp-dir-creation-failed","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"}