{"record":{"id":"e5b1910f80a31989","repo":"wavetermdev/waveterm","slug":"failed-to-start-process-w","errorCode":null,"errorMessage":"failed to start process: %w","messagePattern":"failed to start process: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/buildercontroller/buildercontroller.go","lineNumber":368,"sourceCode":"\t\treturn nil, fmt.Errorf(\"failed to create stdin pipe: %w\", err)\n\t}\n\n\tportChan := make(chan int, 1)\n\tportFound := false\n\n\tbc.outputBuffer.SetLineCallback(func(line string) {\n\t\tif !portFound {\n\t\t\tif port := build.ParseTsunamiPort(line); port > 0 {\n\t\t\t\tportFound = true\n\t\t\t\tportChan <- port\n\t\t\t}\n\t\t}\n\t\tbc.publishOutputLine(line, false)\n\t})\n\n\terr = cmd.Start()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start process: %w\", err)\n\t}\n\n\twaitCh := make(chan struct{})\n\tprocess := &BuilderProcess{\n\t\tCmd:         cmd,\n\t\tStdinWriter: stdinPipe,\n\t\tWaitCh:      waitCh,\n\t}\n\n\tgo func() {\n\t\tprocess.WaitRtn = cmd.Wait()\n\t\tclose(waitCh)\n\t}()\n\n\tgo bc.outputBuffer.ReadAll(stdoutPipe)\n\tgo bc.outputBuffer.ReadAll(stderrPipe)\n\n\terrChan := make(chan error, 1)","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/buildercontroller/buildercontroller.go#L350-L386","documentation":"After configuring the builder subprocess command, runBuilderApp calls cmd.Start(). This error wraps any failure to spawn the process — most commonly the builder binary does not exist at the configured path, lacks execute permission, or the working directory set on the Cmd does not exist.","triggerScenarios":"cmd.Start() fails: builder executable not found (ErrNotFound), not executable (permission denied), configured Dir missing, or fork/exec failure.","commonSituations":"Wave built from source without 'make build' (waveshell binary absent); PATH not carrying the build output dir; antivirus/permission issues; bad working directory in block context.","solutions":["Verify the builder binary exists and is executable at the resolved path (run 'make build' if missing)","Check the wrapped error: 'no such file or directory' means wrong path; 'permission denied' means chmod +x","Ensure the Cmd's Dir (working directory) exists before Start()","Check disk space and container fd/process limits if fork/exec fails"],"exampleFix":"// before\nerr = cmd.Start()\n// after\nif _, err := os.Stat(builderPath); err != nil {\n    return nil, fmt.Errorf(\"builder binary missing at %s (run make build): %w\", builderPath, err)\n}\nerr = cmd.Start()\nif err != nil { return nil, fmt.Errorf(\"failed to start process: %w\", err) }","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(builderBinaryPath); err != nil {\n    return fmt.Errorf(\"builder binary not available: %w\", err)\n}\nif info, err := os.Stat(builderBinaryPath); err == nil && info.Mode()&0o111 == 0 {\n    return fmt.Errorf(\"builder binary is not executable\")\n}","typeGuard":null,"tryCatchPattern":"process, err := bc.runBuilderApp(ctx, ...)\nif err != nil && strings.Contains(err.Error(), \"failed to start process\") {\n    // hint: run 'make build' if the wrapped error is 'no such file or directory'\n    return err\n}","preventionTips":["Run 'make build' after cloning or pulling so the waveshell binary exists","Verify the builder binary path resolution (PATH vs explicit path) in your environment","Ensure the working directory passed to the Cmd exists on every platform","chmod +x the binary if it came from an archive without permissions"],"tags":["go","os-exec","subprocess","spawn-failure"],"backgroundTag":"executable-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}