{"record":{"id":"30f5f9641fbc24e8","repo":"hashicorp/packer","slug":"failed-to-download-packer-release-for-s-s-w","errorCode":null,"errorMessage":"failed to download Packer release for %s/%s: %w","messagePattern":"failed to download Packer release for (.+?)/(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/hcp-sbom/provisioner.go","lineNumber":631,"sourceCode":"func (p *Provisioner) provisionWithNativeGeneration(\n\tctx context.Context, ui packersdk.Ui, comm packersdk.Communicator,\n\tgeneratedData map[string]interface{}, osType, osArch string,\n) error {\n\tui.Say(\"Starting Automatic SBOM generation workflow...\")\n\n\t// Step 1: Download Packer release binary on the host.\n\ttargetGOOS := strings.ToLower(osType)\n\tarchMap := map[string]string{\n\t\t\"x86_64\": \"amd64\", \"aarch64\": \"arm64\", \"i386\": \"386\", \"i686\": \"386\", \"armv7l\": \"arm\", \"armv7\": \"arm\",\n\t}\n\ttargetGOARCH := strings.ToLower(osArch)\n\tif mapped, ok := archMap[targetGOARCH]; ok {\n\t\ttargetGOARCH = mapped\n\t}\n\tui.Say(fmt.Sprintf(\"Downloading latest Packer release for %s/%s from %s...\", targetGOOS, targetGOARCH, getReleaseBaseURL()))\n\tscannerZipPath, err := downloadPackerRelease(ctx, targetGOOS, targetGOARCH)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to download Packer release for %s/%s: %w\", targetGOOS, targetGOARCH, err)\n\t}\n\tdefer func() {\n\t\tif err := os.Remove(scannerZipPath); err != nil && !errors.Is(err, os.ErrNotExist) {\n\t\t\tlog.Printf(\"[WARN] failed to remove temporary Packer release zip %s: %v\", scannerZipPath, err)\n\t\t}\n\t}()\n\n\t// Step 2: Upload scanner to remote.\n\tlog.Println(\"Uploading scanner to remote host...\")\n\tremoteScannerPath, err := p.uploadScanner(ctx, ui, comm, scannerZipPath, osType)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to upload scanner: %s\", err)\n\t}\n\tdefer p.cleanupRemoteFile(ctx, ui, comm, remoteScannerPath)\n\n\t// Step 3: Run scanner on remote\n\tui.Say(fmt.Sprintf(\"Running scanner on remote host (scanning %s)...\", p.config.ScanPath))\n\tremoteSBOMPath, err := p.runScanner(ctx, ui, comm, remoteScannerPath, osType)","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/hcp-sbom/provisioner.go#L613-L649","documentation":"Runtime error from provisionWithNativeGeneration in the hcp-sbom provisioner: downloading the Packer release zip for the guest's GOOS/GOARCH (to use packer's SBOM scanner on the remote host) failed. The wrapped error is from the HTTP download.","triggerScenarios":"Thrown at provisioner/hcp-sbom/provisioner.go:631 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network/egress access to the Packer release host from the build machine and retry","Verify the guest OS/arch maps to a published Packer release (e.g. linux/amd64)"],"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"}