{"record":{"id":"e74ff0226143fb8a","repo":"herdrdev/herdr","slug":"shutdown-was-requested-but-the-old-remote-herdr-s","errorCode":null,"errorMessage":"shutdown was requested, but the old remote herdr server on {target} is still responding after {} seconds","messagePattern":"shutdown was requested, but the old remote herdr server on (.+?) is still responding after (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/remote/attach.rs","lineNumber":1391,"sourceCode":"        return Err(command_failed(\"remote server stop failed\", &output));\n    }\n\n    wait_for_remote_server_shutdown(ssh, remote_herdr)?;\n    eprintln!(\n        \"stopped the remote herdr server on {}; it will restart when the remote client bridge attaches.\",\n        ssh.target()\n    );\n    Ok(())\n}\n\nfn wait_for_remote_server_shutdown(ssh: &RemoteSsh, remote_herdr: &RemoteHerdr) -> io::Result<()> {\n    let deadline = Instant::now() + REMOTE_SERVER_SHUTDOWN_CONFIRM_TIMEOUT;\n    loop {\n        if remote_server_status(ssh, remote_herdr)? == RemoteServerStatus::NotRunning {\n            return Ok(());\n        }\n        if Instant::now() >= deadline {\n            return Err(io::Error::new(\n                io::ErrorKind::TimedOut,\n                format!(\n                    \"shutdown was requested, but the old remote herdr server on {target} is still responding after {} seconds\",\n                    REMOTE_SERVER_SHUTDOWN_CONFIRM_TIMEOUT.as_secs(),\n                    target = ssh.target()\n                ),\n            ));\n        }\n        thread::sleep(REMOTE_SERVER_SHUTDOWN_POLL_INTERVAL);\n    }\n}\n\nfn version_label(version: Option<&str>) -> &str {\n    version.unwrap_or(\"unknown\")\n}\n\nfn warn_if_remote_bin_not_on_path(ssh: &RemoteSsh) -> io::Result<()> {\n    let output = ssh.user_shell_output(\"command -v herdr\")?;","sourceCodeStart":1373,"sourceCodeEnd":1409,"githubUrl":"https://github.com/herdrdev/herdr/blob/f457cff4f2648eee85d176f8a41861241d4e8428/src/remote/attach.rs#L1373-L1409","documentation":"After requesting shutdown of an old remote herdr server, herdr polls remote_server_status until REMOTE_SERVER_SHUTDOWN_CONFIRM_TIMEOUT elapses. If the server is still responding past the deadline, this TimedOut error is raised because the stale server never confirmed shutdown.","triggerScenarios":"Issuing a remote server stop (typically during protocol-mismatch restart) where the remote process ignores or delays the shutdown request, e.g. busy event loop, stuck child panes, or network latency between the SSH control commands and the server.","commonSituations":"Remote host under heavy load, remote herdr version that does not handle shutdown cleanly, SSH multiplexing delays, or a zombie server process holding the socket.","solutions":["SSH into the remote host and kill the stale herdr server process (pkill -f herdr), then retry attach","Check remote system load and disk/socket issues delaying shutdown","Upgrade the remote herdr binary so shutdown handling is current","Retry after manually confirming the remote socket is gone (herdr server status / socket path)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match wait_remote_shutdown(ssh, target) {\n    Err(e) if e.kind() == std::io::ErrorKind::TimedOut => {\n        manually_stop_remote_server().await?;\n        wait_remote_shutdown(ssh, target).await\n    }\n    r => r,\n}","preventionTips":["Monitor remote server health and stop stale servers proactively","Keep remote herdr updated so shutdown handling is reliable","On timeout, fall back to killing the remote process and retry once"],"tags":["timeout","remote-server","shutdown","ssh","rust"],"backgroundTag":"remote-service-shutdown-timeout","analyzedSha":"f457cff4f2648eee85d176f8a41861241d4e8428","analyzedAt":"2026-08-28T15:41:09.197Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}