{"record":{"id":"0ad561af92c4317c","repo":"hashicorp/packer","slug":"s-not-found-in-zip-s","errorCode":null,"errorMessage":"%s not found in zip %s","messagePattern":"(.+?) not found in zip (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/hcp-sbom/provisioner.go","lineNumber":587,"sourceCode":"\t\t}\n\n\t\trc, err := f.Open()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to open %s from zip: %w\", binaryName, err)\n\t\t}\n\n\t\tdata, readErr := io.ReadAll(rc)\n\t\tcloseErr := rc.Close()\n\t\tif readErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read %s from zip: %w\", binaryName, readErr)\n\t\t}\n\t\tif closeErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to close %s stream from zip: %w\", binaryName, closeErr)\n\t\t}\n\t\treturn data, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"%s not found in zip %s\", binaryName, zipPath)\n}\n\n// runRemoteCmd runs a single shell command on the remote host and returns a\n// descriptive error if it fails.\nfunc (p *Provisioner) runRemoteCmd(ctx context.Context, comm packersdk.Communicator, cmdStr, step string) error {\n\tvar stderr bytes.Buffer\n\tcmd := &packersdk.RemoteCmd{\n\t\tCommand: cmdStr,\n\t\tStderr:  &stderr,\n\t}\n\tif err := comm.Start(ctx, cmd); err != nil {\n\t\treturn fmt.Errorf(\"failed to start remote step %q: %s\", step, err)\n\t}\n\tcmd.Wait()\n\tif cmd.ExitStatus() != 0 {\n\t\treturn fmt.Errorf(\"remote step %q failed (exit %d): %s\",\n\t\t\tstep, cmd.ExitStatus(), strings.TrimSpace(stderr.String()))\n\t}","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/hcp-sbom/provisioner.go#L569-L605","documentation":"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.","triggerScenarios":"Thrown at provisioner/hcp-sbom/provisioner.go:587 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the downloaded Packer release zip contains the expected binary name","Retry or pin a known-good Packer version for the SBOM scanner download"],"exampleFix":null,"handlingStrategy":"fallback","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"}