{"record":{"id":"3a218d5f4baaf742","repo":"wezterm/wezterm","slug":"error","errorCode":null,"errorMessage":"Error: {}","messagePattern":"Error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mux/src/ssh.rs","lineNumber":124,"sourceCode":"                            ui.input(editor_prompt)\n                        } else {\n                            ui.password(editor_prompt)\n                        };\n                        if let Ok(line) = res {\n                            answers.push(line);\n                        } else {\n                            anyhow::bail!(\"Authentication was cancelled\");\n                        }\n                    }\n                    smol::block_on(auth.answer(answers))?;\n                }\n                SessionEvent::HostVerificationFailed(failed) => {\n                    let message = format_host_verification_for_terminal(failed);\n                    ui.output(message);\n                    anyhow::bail!(\"Host key verification failed\");\n                }\n                SessionEvent::Error(err) => {\n                    anyhow::bail!(\"Error: {}\", err);\n                }\n                SessionEvent::Authenticated => return Ok(session),\n            }\n        }\n        bail!(\"unable to authenticate session\");\n    })\n}\n\nfn format_host_verification_for_terminal(failed: HostVerificationFailed) -> Vec<Change> {\n    vec![\n        AttributeChange::Intensity(Intensity::Bold).into(),\n        LineAttribute::DoubleHeightTopHalfLine.into(),\n        Change::Text(\"REMOTE HOST IDENTIFICATION CHANGED\\r\\n\".to_string()),\n        LineAttribute::DoubleHeightBottomHalfLine.into(),\n        Change::Text(\"REMOTE HOST IDENTIFICATION CHANGED\\r\\n\".to_string()),\n        Change::Text(\"SOMEONE MAY BE DOING SOMETHING NASTY!\\r\\n\".to_string()),\n        AttributeChange::Intensity(Intensity::Normal).into(),\n        Change::Text(\"\\r\\nThere are two likely causes for this:\\r\\n\".to_string()),","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/wezterm/wezterm/blob/9c04f79f86649f76a8c978ff4b674f60297a6ec9/mux/src/ssh.rs#L106-L142","documentation":"Returned by ssh_connect_with_ui (mux/src/ssh.rs:124) when the SSH session emits SessionEvent::Error(err) during connection/authentication; the payload string is the underlying russh/transport error text. This is the generic failure channel of the wezterm-ssh event loop and covers protocol errors, IO failures, negotiation mismatches, and authentication rejections reported as errors.","triggerScenarios":"TCP connection reset mid-handshake; unsupported algorithm negotiation (old server vs modern client defaults); key exchange failures; server-side auth error events; unreachable networks surfacing as transport errors.","commonSituations":"Flaky networks/VPNs dropping during handshake; connecting to very old or embedded SSH servers that lack modern kex/ciphers; server misconfiguration or fail2ban cutting the connection; firewall RSTs.","solutions":["Read the embedded error text first; it names the actual transport/protocol cause","Test the same host with the OpenSSH cli (`ssh -v host`) to see whether it is server-side or wezterm-specific","For algorithm negotiation issues, pin compatible algorithms in your ssh config (e.g. Ciphers/KexAlgorithms entries the server supports)","For network flakiness, retry the connection; for firewalls/fail2ban, fix the blocking side"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    match ssh_connect_with_ui(config.clone(), &mut ui) {\n        Ok(session) => break Ok(session),\n        Err(err) if err.to_string().starts_with(\"Error: \") && attempt < 3 => {\n            attempt += 1; // transport/protocol error: brief backoff, then retry\n            std::thread::sleep(std::time::Duration::from_millis(500 * attempt as u64));\n        }\n        Err(err) => break Err(err),\n    }\n}","preventionTips":["Read the embedded transport text; it distinguishes auth rejection from network failure","Cross-check with `ssh -v` against the same host when failures repeat","Pin compatible KexAlgorithms/Ciphers for old servers in ssh config"],"tags":["ssh","transport","protocol-error","connection","rust","wezterm"],"backgroundTag":"ssh-connection-error","analyzedSha":"9c04f79f86649f76a8c978ff4b674f60297a6ec9","analyzedAt":"2026-08-16T21:23:27.157Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}