{"record":{"id":"c1e3cf3b333654eb","repo":"go-delve/delve","slug":"could-not-launch-process-s","errorCode":null,"errorMessage":"could not launch process: %s","messagePattern":"could not launch process: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/debugger/debugger.go","lineNumber":232,"sourceCode":"\t\t}\n\t\tif err != nil {\n\t\t\terr = go11DecodeErrorCheck(err)\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := d.checkGoVersion(); err != nil {\n\t\t\td.target.Detach(true)\n\t\t\treturn nil, err\n\t\t}\n\n\tdefault:\n\t\td.log.Infof(\"launching process with args: %v\", d.processArgs)\n\t\tvar err error\n\t\td.target, err = d.Launch(d.processArgs, d.config.WorkingDir)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, &proc.ErrUnsupportedArch{}) {\n\t\t\t\terr = go11DecodeErrorCheck(err)\n\t\t\t\terr = noDebugErrorWarning(err)\n\t\t\t\terr = fmt.Errorf(\"could not launch process: %s\", err)\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := d.checkGoVersion(); err != nil {\n\t\t\td.target.Detach(true)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn d, nil\n}\n\n// canRestart returns true if the target was started with Launch and can be restarted\nfunc (d *Debugger) canRestart() bool {\n\tswitch {\n\tcase d.config.AttachPid > 0:\n\t\treturn false\n\tcase d.config.CoreFile != \"\":","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/debugger/debugger.go#L214-L250","documentation":"The debuggee process could not be launched by proc.Launch. The underlying error (e.g. binary not found, compile failure, unsupported ELF, permission denied) is wrapped with the 'could not launch process:' prefix unless it is an ErrUnsupportedArch.","triggerScenarios":"service/debugger.New with AttachPid==0 and AttachWaitFor==\"\" calls d.Launch(processArgs, workingDir), which fails — bad program path, non-Go binary, exec format error, missing working directory.","commonSituations":"Wrong 'program' path in launch config, target built for a different OS/arch, missing execute permission, Go version too new for the delve build (checkGoVersion related), noDebug mode issues.","solutions":["Verify the program path/args in the launch config point to an existing, executable Go binary or package directory","Rebuild the target for the host GOOS/GOARCH","Check the wrapped underlying error message for the exact cause (not found vs permission vs format)","Ensure the working directory exists and is accessible","Update delve if the target uses a newer Go version"],"exampleFix":"// before\n{\"request\":\"launch\",\"mode\":\"debug\",\"program\":\"./cmd/app\"} // dir does not exist\n// after\n{\"request\":\"launch\",\"mode\":\"debug\",\"program\":\"/abs/path/to/cmd/app\"}","handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(programPath); err != nil { return fmt.Errorf(\"program not found: %w\", err) }","typeGuard":null,"tryCatchPattern":"_, err := debugger.New(cfg, log)\nif err != nil && strings.Contains(err.Error(), \"could not launch process\") {\n  // inspect wrapped cause: not-found, permission, exec format\n}","preventionTips":["Use absolute paths for program in launch configs","Test the binary runs standalone before debugging it","Match delve build to the target's Go version"],"tags":["launch","process","dap","exec"],"backgroundTag":"process-launch-failed","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}