hashicorp/packer · error

%s not found in zip %s

Error message

%s not found in zip %s

What it means

Runtime error from extractBinaryFromZip: no zip entry matches the expected scanner binary name, so the release archive doesn't contain the binary for this provisioner's expectations — wrong release layout or unexpected asset naming.

Source

Thrown at provisioner/hcp-sbom/provisioner.go:587

		}

		rc, err := f.Open()
		if err != nil {
			return nil, fmt.Errorf("failed to open %s from zip: %w", binaryName, err)
		}

		data, readErr := io.ReadAll(rc)
		closeErr := rc.Close()
		if readErr != nil {
			return nil, fmt.Errorf("failed to read %s from zip: %w", binaryName, readErr)
		}
		if closeErr != nil {
			return nil, fmt.Errorf("failed to close %s stream from zip: %w", binaryName, closeErr)
		}
		return data, nil
	}

	return nil, fmt.Errorf("%s not found in zip %s", binaryName, zipPath)
}

// runRemoteCmd runs a single shell command on the remote host and returns a
// descriptive error if it fails.
func (p *Provisioner) runRemoteCmd(ctx context.Context, comm packersdk.Communicator, cmdStr, step string) error {
	var stderr bytes.Buffer
	cmd := &packersdk.RemoteCmd{
		Command: cmdStr,
		Stderr:  &stderr,
	}
	if err := comm.Start(ctx, cmd); err != nil {
		return fmt.Errorf("failed to start remote step %q: %s", step, err)
	}
	cmd.Wait()
	if cmd.ExitStatus() != 0 {
		return fmt.Errorf("remote step %q failed (exit %d): %s",
			step, cmd.ExitStatus(), strings.TrimSpace(stderr.String()))
	}

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Verify the downloaded Packer release zip contains the expected binary name
  2. Retry or pin a known-good Packer version for the SBOM scanner download
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at provisioner/hcp-sbom/provisioner.go:587 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/0ad561af92c4317c. Report an issue: GitHub.