{"record":{"id":"090e7d79a8c8d7b4","repo":"hashicorp/packer","slug":"failed-to-run-scanner-s","errorCode":null,"errorMessage":"failed to run scanner: %s","messagePattern":"failed to run scanner: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/hcp-sbom/provisioner.go","lineNumber":651,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run scanner: %s\", err)\n\t}\n\tdefer p.cleanupRemoteFile(ctx, ui, comm, remoteSBOMPath)\n\n\t// Step 4: Download SBOM from remote\n\tlog.Println(\"Downloading SBOM from remote host...\")\n\tsbomData, err := p.downloadSBOM(ctx, ui, comm, remoteSBOMPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to download SBOM: %s\", err)\n\t}\n\n\t// Step 5: Process SBOM for HCP (validate, compress, store)\n\tlog.Println(\"Processing SBOM for HCP Packer...\")\n\tif err := p.processSBOMForHCP(generatedData, sbomData); err != nil {\n\t\treturn fmt.Errorf(\"failed to process SBOM: %s\", err)\n\t}\n\n\tui.Say(\"Automatic SBOM generation completed successfully\")\n\treturn nil","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/hcp-sbom/provisioner.go#L633-L669","documentation":"Runtime error from provisionWithNativeGeneration: the SBOM scanner executed on the remote host failed or its result could not be retrieved. The wrapped error typically contains the remote exit status/stderr from running the scanner.","triggerScenarios":"Thrown at provisioner/hcp-sbom/provisioner.go:651 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the included remote stderr for the scanner's failure reason","Ensure the remote host has any runtime deps the scanner needs and retry","Check disk space on the remote for scan output"],"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"}