hashicorp/packer · error

could not find a %q file in zipfile

Error message

could not find a %q file in zipfile

What it means

Plugin installation error from InstallLatest: the expected binary (e.g. packer-plugin-docker_v1.2.3_x5.0_linux_amd64) is not among the files in the downloaded zip, so there is nothing to install. Typically a wrong or incomplete release asset.

Source

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

					if err != nil {
						errs = multierror.Append(errs, fmt.Errorf("zip : %v", err))
						return nil, errs
					}

					var copyFrom io.ReadCloser
					for _, f := range zr.File {
						if f.Name != expectedBinaryFilename {
							continue
						}
						copyFrom, err = f.Open()
						if err != nil {
							errs = multierror.Append(errs, fmt.Errorf("failed to open temp file: %w", err))
							return nil, errs
						}
						break
					}
					if copyFrom == nil {
						err := fmt.Errorf("could not find a %q file in zipfile", expectedBinaryFilename)
						errs = multierror.Append(errs, err)
						return nil, errs
					}

					var outputFileData bytes.Buffer
					if _, err := io.Copy(&outputFileData, copyFrom); err != nil {
						err := fmt.Errorf("extract file: %w", err)
						errs = multierror.Append(errs, err)
						return nil, errs
					}
					tmpBinFileName := filepath.Join(os.TempDir(), expectedBinaryFilename)
					tmpOutputFile, err := os.OpenFile(tmpBinFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
					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() {

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Check the release zip actually contains the plugin binary for your OS/arch
  2. Retry with another version or mirror of the plugin release
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packer/plugin-getter/plugins.go:867 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/cf42bac0b165d96e. Report an issue: GitHub.