docker/compose · warning
could not open Docker Desktop
Error message
could not open Docker Desktop
What it means
Raised by the interactive compose log keyboard (docker compose up with the navigation menu) when the user presses 'v' to open the project in Docker Desktop and open.Run on the docker-desktop://dashboard/apps/<project> URL fails. The handler runs in a detached goroutine, so the error only surfaces in the TUI error area (keyboardError("View", ...)), never aborts compose. Note the code overwrites the underlying open.Run error (fmt.Errorf without %w), so the real OS-level cause is hidden.
Source
Thrown at cmd/formatter/shortcut.go:216
// clearLine()
for range height {
moveCursorDown(1)
clearLine()
}
restoreCursor()
}
func (lk *LogKeyboard) openDockerDesktop(ctx context.Context, project *types.Project) {
if !lk.IsDockerDesktopActive {
return
}
go func() {
_ = tracing.EventWrapFuncForErrGroup(ctx, "menu/gui", tracing.SpanOptions{},
func(ctx context.Context) error {
link := fmt.Sprintf("docker-desktop://dashboard/apps/%s", project.Name)
err := open.Run(link)
if err != nil {
err = fmt.Errorf("could not open Docker Desktop")
lk.keyboardError("View", err)
}
return err
})()
}()
}
func (lk *LogKeyboard) openDDComposeUI(ctx context.Context, project *types.Project) {
if !lk.IsDockerDesktopActive {
return
}
go func() {
_ = tracing.EventWrapFuncForErrGroup(ctx, "menu/gui/composeview", tracing.SpanOptions{},
func(ctx context.Context) error {
link := fmt.Sprintf("docker-desktop://dashboard/docker-compose/%s", project.Name)
err := open.Run(link)
if err != nil {
err = fmt.Errorf("could not open Docker Desktop Compose UI")View on GitHub (pinned to ddc4b044b6)
Solutions
- Verify Docker Desktop is actually installed and running (open it manually once, then retry 'v').
- Test the scheme handler from a shell: xdg-open 'docker-desktop://dashboard' (Linux) or open 'docker-desktop://dashboard' (macOS); if it fails, reinstall/repair Docker Desktop.
- Restart Docker Desktop so it re-registers its URL scheme handler, then press 'v' again.
- If you do not use Docker Desktop, ignore the error (compose keeps running) and stop pressing 'v'; optionally unset DD detection by pointing DOCKER_HOST at a plain engine socket.
- If you maintain this code, wrap the underlying error (fmt.Errorf("could not open Docker Desktop: %w", err)) so diagnostics are possible.
Example fix
// before (cmd/formatter/shortcut.go)
err := open.Run(link)
if err != nil {
err = fmt.Errorf("could not open Docker Desktop")
lk.keyboardError("View", err)
}
// after
err := open.Run(link)
if err != nil {
err = fmt.Errorf("could not open Docker Desktop: %w", err)
lk.keyboardError("View", err)
} Defensive patterns
Strategy: fallback
Validate before calling
// before showing the menu, probe that the scheme is openable once
func canOpenDD() bool {
return open.Run("docker-desktop://dashboard") == nil
}
// gate the 'v' hint on canOpenDD() Try / catch
// the action is best-effort inside a goroutine; log and keep the TUI alive
err := open.Run(link)
if err != nil {
lk.keyboardError("View", fmt.Errorf("could not open Docker Desktop: %w", err))
// do NOT propagate: compose must keep running
} Prevention
- Treat all menu GUI shortcuts as optional; never let their errors affect process exit code.
- Verify Docker Desktop is installed/running before enabling deep-link shortcuts.
- Always wrap open.Run errors with %w so the OS cause is diagnosable.
When it happens
Trigger: Pressing 'v' in the compose menu while LogKeyboard.IsDockerDesktopActive is true, on a host where the OS cannot resolve the docker-desktop:// URL scheme (no registered handler, xdg-open failure, Docker Desktop uninstalled or broken install).
Common situations: Docker Desktop was detected via its backend socket but the desktop app itself is broken or was uninstalled without cleaning the socket; running on Linux where xdg-open has no handler for docker-desktop://; headless/Wayland sessions where opening external URLs fails; stale IsDockerDesktopActive detection after DD quits while compose is still attached.
Related errors
- could not open Docker Desktop Compose UI
- could not open Docker Desktop Logs view: %w
- watch is not yet configured. Learn more: %s
- unexpected status code: %d
AI-assisted analysis of docker/compose@ddc4b044b6 (2026-08-15).
Data as JSON: /api/errors/70833f23b4ee78c6.
Report an issue: GitHub.