{"record":{"id":"70833f23b4ee78c6","repo":"docker/compose","slug":"could-not-open-docker-desktop","errorCode":null,"errorMessage":"could not open Docker Desktop","messagePattern":"could not open Docker Desktop","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/formatter/shortcut.go","lineNumber":216,"sourceCode":"\t// clearLine()\n\tfor range height {\n\t\tmoveCursorDown(1)\n\t\tclearLine()\n\t}\n\trestoreCursor()\n}\n\nfunc (lk *LogKeyboard) openDockerDesktop(ctx context.Context, project *types.Project) {\n\tif !lk.IsDockerDesktopActive {\n\t\treturn\n\t}\n\tgo func() {\n\t\t_ = tracing.EventWrapFuncForErrGroup(ctx, \"menu/gui\", tracing.SpanOptions{},\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\tlink := fmt.Sprintf(\"docker-desktop://dashboard/apps/%s\", project.Name)\n\t\t\t\terr := open.Run(link)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = fmt.Errorf(\"could not open Docker Desktop\")\n\t\t\t\t\tlk.keyboardError(\"View\", err)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t})()\n\t}()\n}\n\nfunc (lk *LogKeyboard) openDDComposeUI(ctx context.Context, project *types.Project) {\n\tif !lk.IsDockerDesktopActive {\n\t\treturn\n\t}\n\tgo func() {\n\t\t_ = tracing.EventWrapFuncForErrGroup(ctx, \"menu/gui/composeview\", tracing.SpanOptions{},\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\tlink := fmt.Sprintf(\"docker-desktop://dashboard/docker-compose/%s\", project.Name)\n\t\t\t\terr := open.Run(link)\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = fmt.Errorf(\"could not open Docker Desktop Compose UI\")","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/cmd/formatter/shortcut.go#L198-L234","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before (cmd/formatter/shortcut.go)\nerr := open.Run(link)\nif err != nil {\n    err = fmt.Errorf(\"could not open Docker Desktop\")\n    lk.keyboardError(\"View\", err)\n}\n\n// after\nerr := open.Run(link)\nif err != nil {\n    err = fmt.Errorf(\"could not open Docker Desktop: %w\", err)\n    lk.keyboardError(\"View\", err)\n}","handlingStrategy":"fallback","validationCode":"// before showing the menu, probe that the scheme is openable once\nfunc canOpenDD() bool {\n    return open.Run(\"docker-desktop://dashboard\") == nil\n}\n// gate the 'v' hint on canOpenDD()","typeGuard":null,"tryCatchPattern":"// the action is best-effort inside a goroutine; log and keep the TUI alive\nerr := open.Run(link)\nif err != nil {\n    lk.keyboardError(\"View\", fmt.Errorf(\"could not open Docker Desktop: %w\", err))\n    // do NOT propagate: compose must keep running\n}","preventionTips":["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."],"tags":["docker-desktop","keyboard-menu","gui","url-scheme","tui"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}