{"record":{"id":"f1172bf08de4be83","repo":"GoogleContainerTools/skaffold","slug":"tempdir-w","errorCode":null,"errorMessage":"tempdir: %w","messagePattern":"tempdir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/deploy/helm/helm.go","lineNumber":672,"sourceCode":"\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}, opts)\n\n\tolog.Entry(ctx).Debug(b.String())\n\n\treturn b.Bytes(), err\n}\n\n// packageChart packages the chart and returns the path to the resulting chart archive\nfunc (h *Deployer) packageChart(ctx context.Context, r latest.HelmRelease) (string, error) {\n\t// Allow a test to sneak a predictable path in\n\ttmpDir := h.pkgTmpDir\n\n\tif tmpDir == \"\" {\n\t\tt, err := os.MkdirTemp(\"\", \"skaffold-helm\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"tempdir: %w\", err)\n\t\t}\n\t\ttmpDir = t\n\t}\n\n\targs := []string{\"package\", r.ChartPath, \"--destination\", tmpDir}\n\n\tif r.Packaged.Version != \"\" {\n\t\tv, err := util.ExpandEnvTemplate(r.Packaged.Version, nil)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"packaged.version template: %w\", err)\n\t\t}\n\t\targs = append(args, \"--version\", v)\n\t}\n\n\tif r.Packaged.AppVersion != \"\" {\n\t\tav, err := util.ExpandEnvTemplate(r.Packaged.AppVersion, nil)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"packaged.appVersion template: %w\", err)","sourceCodeStart":654,"sourceCodeEnd":690,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/deploy/helm/helm.go#L654-L690","documentation":"Wraps os.MkdirTemp failure when packageChart creates a temporary directory to hold the helm-packaged .tgz chart. Without a writable temp dir, the chart cannot be packaged locally before install/upgrade.","triggerScenarios":"Calling Deploy with `helm` releases that require packaging (e.g. local chartPath) when TMPDIR is unwritable, full, or points to a nonexistent path.","commonSituations":"Containers with read-only /tmp, disk quota exceeded, TMPDIR exported to a missing directory in CI.","solutions":["Ensure TMPDIR (or /tmp) exists and is writable: `mktemp -d` to test","Free disk space if the volume is full","Override h.pkgTmpDir (test hook) to a writable directory"],"exampleFix":"// before\nENV TMPDIR=/nonexistent\nskaffold run\n// after\nENV TMPDIR=/tmp\nskaffold run","handlingStrategy":"validation","validationCode":"dir := os.Getenv(\"TMPDIR\")\nif dir == \"\" { dir = \"/tmp\" }\nfi, err := os.Stat(dir)\nif err != nil || !fi.IsDir() { return fmt.Errorf(\"TMPDIR %s missing\", dir) }\nif err := unix.Access(dir, unix.W_OK); err != nil { return fmt.Errorf(\"TMPDIR %s not writable\", dir) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify TMPDIR exists and is writable in deploy containers","Keep free disk space monitored","Test `mktemp -d` as a preflight in CI"],"tags":["helm","filesystem","tempdir"],"backgroundTag":"temp-dir-unwritable","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"}