go-delve/delve · error
could not launch process: %s
Error message
could not launch process: %s
What it means
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.
Source
Thrown at service/debugger/debugger.go:232
}
if err != nil {
err = go11DecodeErrorCheck(err)
return nil, err
}
if err := d.checkGoVersion(); err != nil {
d.target.Detach(true)
return nil, err
}
default:
d.log.Infof("launching process with args: %v", d.processArgs)
var err error
d.target, err = d.Launch(d.processArgs, d.config.WorkingDir)
if err != nil {
if !errors.Is(err, &proc.ErrUnsupportedArch{}) {
err = go11DecodeErrorCheck(err)
err = noDebugErrorWarning(err)
err = fmt.Errorf("could not launch process: %s", err)
}
return nil, err
}
if err := d.checkGoVersion(); err != nil {
d.target.Detach(true)
return nil, err
}
}
return d, nil
}
// canRestart returns true if the target was started with Launch and can be restarted
func (d *Debugger) canRestart() bool {
switch {
case d.config.AttachPid > 0:
return false
case d.config.CoreFile != "":View on GitHub (pinned to a23773e6c3)
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
Example fix
// before
{"request":"launch","mode":"debug","program":"./cmd/app"} // dir does not exist
// after
{"request":"launch","mode":"debug","program":"/abs/path/to/cmd/app"} Defensive patterns
Strategy: try-catch
Validate before calling
if _, err := os.Stat(programPath); err != nil { return fmt.Errorf("program not found: %w", err) } Try / catch
_, err := debugger.New(cfg, log)
if err != nil && strings.Contains(err.Error(), "could not launch process") {
// inspect wrapped cause: not-found, permission, exec format
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- another launch request is in progress
- could not open stdin file: %v
- could not create stdout file: %v
- could not create stderr file: %v
- could not get thread count
AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31).
Data as JSON: /api/errors/c1e3cf3b333654eb.
Report an issue: GitHub.