{"record":{"id":"0d42db4c110791d2","repo":"hashicorp/packer","slug":"failed-to-start-remote-step-q-s","errorCode":null,"errorMessage":"failed to start remote step %q: %s","messagePattern":"failed to start remote step %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/hcp-sbom/provisioner.go","lineNumber":599,"sourceCode":"\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}\n\treturn nil\n}\n\n// provisionWithNativeGeneration handles the native SBOM generation flow.\n// The Packer release binary is downloaded on the host (works in air-gapped\n// environments where the VM has no internet access), verified, then uploaded\n// to the remote host via the communicator before running `packer sbom-generate`.\nfunc (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...\")","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/hcp-sbom/provisioner.go#L581-L617","documentation":"Runtime error from runRemoteCmd in the hcp-sbom provisioner: the communicator failed to even start the remote command (e.g. uploading path prep, chmod, or the scanner invocation) — connection lost or the command couldn't be launched, before any exit code exists.","triggerScenarios":"Thrown at provisioner/hcp-sbom/provisioner.go:599 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check SSH/WinRM connectivity to the build machine and retry","Verify the remote shell and target paths (e.g. /tmp) are usable"],"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"}