{"record":{"id":"36f3aff1e9462a0f","repo":"hashicorp/packer","slug":"failed-to-upload-scanner-s","errorCode":null,"errorMessage":"failed to upload scanner: %s","messagePattern":"failed to upload scanner: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/hcp-sbom/provisioner.go","lineNumber":643,"sourceCode":"\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)\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","sourceCodeStart":625,"sourceCodeEnd":661,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/hcp-sbom/provisioner.go#L625-L661","documentation":"Runtime error from provisionWithNativeGeneration: after download and extraction, the scanner binary could not be uploaded to the remote machine (uploadScanner failed) — upload path/permission/connectivity problem reported via the communicator.","triggerScenarios":"Thrown at provisioner/hcp-sbom/provisioner.go:643 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the remote upload directory (default /tmp) is writable and not full","Verify SSH/WinRM connectivity persists through the provision step and retry"],"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"}