{"record":{"id":"846922cfdeaf72ad","repo":"hashicorp/packer","slug":"could-not-create-temporary-file-to-download-plugin","errorCode":null,"errorMessage":"could not create temporary file to download plugin: %w","messagePattern":"could not create temporary file to download plugin: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/plugins.go","lineNumber":818,"sourceCode":"\t\t\t\t\tremoteZipFile, err := getter.Get(\"zip\", GetOptions{\n\t\t\t\t\t\tPluginRequirement:         pr,\n\t\t\t\t\t\tBinaryInstallationOptions: opts.BinaryInstallationOptions,\n\t\t\t\t\t\tversion:                   version,\n\t\t\t\t\t\texpectedZipFilename:       expectedZipFilename,\n\t\t\t\t\t})\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tif errors.Is(err, HTTPFailure) {\n\t\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t\t}\n\t\t\t\t\t\terrs = multierror.Append(errs,\n\t\t\t\t\t\t\tfmt.Errorf(\"could not get binary for %s version %s. Is the file present on the release and correctly named ? %s\",\n\t\t\t\t\t\t\t\tpr.Identifier, version, err))\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\t// create temporary file that will receive a temporary binary.zip\n\t\t\t\t\ttmpFile, err := tmp.File(\"packer-plugin-*.zip\")\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terr = fmt.Errorf(\"could not create temporary file to download plugin: %w\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\treturn nil, errs\n\t\t\t\t\t}\n\t\t\t\t\tdefer func() {\n\t\t\t\t\t\ttmpFilePath := tmpFile.Name()\n\t\t\t\t\t\ttmpFile.Close()\n\t\t\t\t\t\tos.Remove(tmpFilePath)\n\t\t\t\t\t}()\n\n\t\t\t\t\t// write binary to tmp file\n\t\t\t\t\t_, err = io.Copy(tmpFile, remoteZipFile)\n\t\t\t\t\t_ = remoteZipFile.Close()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terr := fmt.Errorf(\"Error getting plugin, trying another getter: %w\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif _, err := tmpFile.Seek(0, 0); err != nil {","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/plugins.go#L800-L836","documentation":"Plugin installation error from InstallLatest: Packer could not create the local temporary .zip file used to stage the downloaded plugin binary — usually a full or unwritable temp directory. This aborts the install loop (returns immediately).","triggerScenarios":"Thrown at packer/plugin-getter/plugins.go:818 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free up space or fix permissions in TMPDIR / the system temp directory","Set TMPDIR to a writable location with sufficient space and retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}