{"record":{"id":"0a686bef91dd79d3","repo":"github/github-mcp-server","slug":"unsupported-platform-s","errorCode":null,"errorMessage":"unsupported platform: %s","messagePattern":"unsupported platform: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/oauth/env.go","lineNumber":36,"sourceCode":"\n// openBrowser tries to open url in the user's default browser. It returns an\n// error when no browser can plausibly be launched so the caller can fall back\n// to elicitation. On Linux it treats a headless session (no display server) as\n// unopenable, which is the common case for SSH and containers.\nfunc openBrowser(url string) error {\n\tvar cmd *exec.Cmd\n\tswitch runtime.GOOS {\n\tcase \"linux\":\n\t\tif os.Getenv(\"DISPLAY\") == \"\" && os.Getenv(\"WAYLAND_DISPLAY\") == \"\" {\n\t\t\treturn errNoDisplay\n\t\t}\n\t\tcmd = exec.Command(\"xdg-open\", url)\n\tcase \"darwin\":\n\t\tcmd = exec.Command(\"open\", url)\n\tcase \"windows\":\n\t\tcmd = exec.Command(\"rundll32\", \"url.dll,FileProtocolHandler\", url)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported platform: %s\", runtime.GOOS)\n\t}\n\n\tcmd.Stdout = io.Discard\n\tcmd.Stderr = io.Discard\n\tif err := cmd.Start(); err != nil {\n\t\treturn err\n\t}\n\t// The launcher (xdg-open/open/rundll32) exits as soon as it hands off to the\n\t// browser. Reap it asynchronously so it does not linger as a zombie for the\n\t// lifetime of this long-running server.\n\tgo func() { _ = cmd.Wait() }()\n\treturn nil\n}\n\n// isRunningInDocker reports whether the process is running inside a Docker (or\n// containerd) container. Detection relies on Linux-specific paths and is always\n// false elsewhere. It is used only to skip a PKCE flow that cannot work: a\n// random callback port inside a container cannot be reached from the host","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/internal/oauth/env.go#L18-L54","documentation":"openURL has no launcher for runtime.GOOS: the switch covers linux (xdg-open), darwin (open), windows (rundll32) and rejects everything else (freebsd, android, js/wasm, plan9...). In the managed flow this error is a signal, not a dead end — beginPKCE treats a non-nil openURL error by falling back to URL elicitation or the manual authorization URL. It only surfaces raw to callers invoking openURL directly.","triggerScenarios":"The binary runs on an OS outside the switch (internal/oauth/env.go:25-37), e.g. built for freebsd/arm64 or GOOS=js; on linux the DISPLAY/WAYLAND_DISPLAY check can instead return errNoDisplay (a different, handled error); every non-covered GOOS returns fmt.Errorf(\"unsupported platform: %s\", runtime.GOOS).","commonSituations":"Community builds for BSD; experimental wasm builds; cross-compiled binaries tested on unusual OSes; ChromeOS Crostini is linux and fine, but true chromeos builds would hit this.","solutions":["Rely on the fallback: the flow prints/elicits the authorization URL — open it manually in any browser","On an unsupported OS, set BROWSER or implement your own opener and use the URL-elicitation prompt path","Build/run on a supported platform (linux, macOS, windows) for auto-open behavior"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := m.openURL(u); err != nil {\n    // fall back to URL elicitation / manual instructions — the flow already does this internally\n    prompter.PromptURL(ctx, Prompt{URL: u})\n}","preventionTips":["On niche platforms, rely on the prompted/manual authorization URL instead of auto-open","Consider setting a BROWSER launcher convention for unsupported GOOS builds"],"tags":["platform","browser","oauth","portability"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}