{"record":{"id":"3a2c7022b2f1e0c9","repo":"jdx/mise","slug":"github-relay-requires-a-posix-target","errorCode":null,"errorMessage":"GitHub relay requires a POSIX target: {}","messagePattern":"GitHub relay requires a POSIX target: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/ssh.rs","lineNumber":170,"sourceCode":"        )?;\n        if let Some(socket) = self.relay_session {\n            if scope.is_some() {\n                bail!(\"cannot nest relay sessions\");\n            }\n            #[cfg(unix)]\n            {\n                crate::ui::ctrlc::exit_on_ctrl_c(false);\n                let mut command = self.command;\n                if let Some(first) = self.destination {\n                    command.insert(0, first);\n                }\n                return crate::system::remote::interruptible(crate::github_relay::unix::session(\n                    &socket, command,\n                ))\n                .await;\n            }\n            #[cfg(not(unix))]\n            bail!(\"GitHub relay requires a POSIX target: {}\", socket.display());\n        }\n        let destination = self\n            .destination\n            .ok_or_else(|| eyre::eyre!(\"an SSH destination is required\"))?;\n        if let Some(scope) = scope {\n            #[cfg(unix)]\n            {\n                let mut host = crate::system::remote::ad_hoc_host(\n                    &destination,\n                    std::env::current_dir()?,\n                    &[],\n                )?;\n                host.port = self.port;\n                host.identity_file = self.identity_file;\n                host.ssh_options = self.ssh_option;\n                return crate::system::remote::ssh(&host, scope, &self.command).await;\n            }\n            #[cfg(not(unix))]","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/ssh.rs#L152-L188","documentation":"The GitHub relay feature of `mise ssh` is implemented only for POSIX (Unix) platforms (src/cli/ssh.rs:170). When relay is requested on a non-Unix target (e.g. Windows), the `#[cfg(not(unix))]` branch bails, including the relay socket path in the message.","triggerScenarios":"Running any `mise ssh` command with GitHub relay options (`--relay-session` or relay scope) on a non-Unix build (Windows), where the unix-only relay session module is compiled out.","commonSituations":"Using mise ssh relay from Windows or Windows-targeted binaries; cross-platform scripts that unconditionally pass relay flags; CI runners on Windows executing the same relay command used on macOS/Linux.","solutions":["Run the relay command on Linux or macOS.","Remove the relay flags on Windows and use plain SSH without GitHub relay.","Wrap relay usage with an OS check in scripts (e.g. only pass relay flags when `uname` is Linux/Darwin)."],"exampleFix":"// before (any OS)\nmise ssh host --github-relay ...\n\n// after (script guard)\nif [ \"$(uname -s)\" = Linux ] || [ \"$(uname -s)\" = Darwin ]; then mise ssh host --github-relay ...; else mise ssh host; fi","handlingStrategy":"validation","validationCode":"const relaySupported = process.platform === 'linux' || process.platform === 'darwin';\nif (wantRelay && !relaySupported) throw new Error('GitHub relay requires Linux or macOS');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate relay flags on OS detection in scripts.","Document that relay is POSIX-only for the team.","Keep Windows CI jobs on plain ssh paths."],"tags":["ssh","relay","platform","windows"],"backgroundTag":"unsupported-platform","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}