rustdesk/rustdesk · error · anyhow::Error

Failed to complete pipe connection {}: {}

Error message

Failed to complete pipe connection {}: {}

What it means

After the wait was signalled, GetOverlappedResult reported failure for the pipe connection: the overlapped ConnectNamedPipe completed with an error (e.g. client disconnected between connect and completion, or broken pipe). Both the pipe name and OS error are reported before the handle is closed.

Source

Thrown at src/server/terminal_helper.rs:655

                    "Timeout waiting for pipe connection: {}",
                    pipe_name
                ));
            }

            // Check if connection was successful
            let mut bytes_transferred = 0u32;
            let overlapped_result = unsafe {
                GetOverlappedResult(
                    pipe_handle.as_raw(),
                    &overlapped,
                    &mut bytes_transferred,
                    false,
                )
            };
            if overlapped_result.is_err() {
                let err = std::io::Error::last_os_error();
                log::error!("Failed to complete pipe connection {}: {}", pipe_name, err);
                return Err(anyhow!(
                    "Failed to complete pipe connection {}: {}",
                    pipe_name,
                    err
                ));
            }

            log::debug!("Pipe connected: {}", pipe_name);
        } else {
            log::error!("Failed to connect named pipe {}: {}", pipe_name, err);
            return Err(anyhow!(
                "Failed to connect named pipe {}: {}",
                pipe_name,
                err
            ));
        }
    } else {
        log::debug!("Pipe connected immediately: {}", pipe_name);
    }

View on GitHub (pinned to 91c9fccbb0)

Solutions

  1. Retry terminal creation — the helper may have crashed or exited right after connecting; check its exit code
  2. Inspect the appended OS error (ERROR_BROKEN_PIPE, ERROR_NO_DATA point to the client side vanishing)
  3. Ensure the helper binary version matches the service (a mismatched helper can mishandle the pipe protocol)
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/server/terminal_helper.rs:655 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rustdesk/rustdesk@91c9fccbb0 (2026-09-10). Data as JSON: /api/errors/f4142caca2edeced. Report an issue: GitHub.