hashicorp/packer · error

could not create temporary file to download plugin: %w

Error message

could not create temporary file to download plugin: %w

What it means

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).

Source

Thrown at packer/plugin-getter/plugins.go:818

					remoteZipFile, err := getter.Get("zip", GetOptions{
						PluginRequirement:         pr,
						BinaryInstallationOptions: opts.BinaryInstallationOptions,
						version:                   version,
						expectedZipFilename:       expectedZipFilename,
					})
					if err != nil {
						if errors.Is(err, HTTPFailure) {
							return nil, err
						}
						errs = multierror.Append(errs,
							fmt.Errorf("could not get binary for %s version %s. Is the file present on the release and correctly named ? %s",
								pr.Identifier, version, err))
						continue
					}
					// create temporary file that will receive a temporary binary.zip
					tmpFile, err := tmp.File("packer-plugin-*.zip")
					if err != nil {
						err = fmt.Errorf("could not create temporary file to download plugin: %w", err)
						errs = multierror.Append(errs, err)
						return nil, errs
					}
					defer func() {
						tmpFilePath := tmpFile.Name()
						tmpFile.Close()
						os.Remove(tmpFilePath)
					}()

					// write binary to tmp file
					_, err = io.Copy(tmpFile, remoteZipFile)
					_ = remoteZipFile.Close()
					if err != nil {
						err := fmt.Errorf("Error getting plugin, trying another getter: %w", err)
						errs = multierror.Append(errs, err)
						continue
					}
					if _, err := tmpFile.Seek(0, 0); err != nil {

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Free up space or fix permissions in TMPDIR / the system temp directory
  2. Set TMPDIR to a writable location with sufficient space and retry
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packer/plugin-getter/plugins.go:818 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/846922cfdeaf72ad. Report an issue: GitHub.