rustdesk/rustdesk · error

create-session: {error}

Error message

create-session: {error}

What it means

The CreateSession portal flow failed while obtaining the Request object path: get_request_path could not compute/uniquefy the request token path before subscribing to the Response signal. dbus_stage_err wraps it with the 'create-session' stage label.

Source

Thrown at libs/scrap/src/wayland/pipewire.rs:814

    );

    let mut is_support_restore_token = false;
    if let Ok(version) = screencast_portal::version(&portal) {
        if version >= 4 {
            is_support_restore_token = true;
        }
    }

    // The following code may be improved.
    // https://flatpak.github.io/xdg-desktop-portal/#:~:text=To%20avoid%20a%20race%20condition
    // To avoid a race condition
    // between the caller subscribing to the signal after receiving the reply for the method call and the signal getting emitted,
    // a convention for Request object paths has been established that allows
    // the caller to subscribe to the signal before making the method call.
    handle_response(
        &conn,
        get_request_path(&conn, create_session_handle_token)
            .map_err(|e| anyhow!(dbus_stage_err("create-session", &e)))?,
        on_create_session_response(
            fd.clone(),
            streams.clone(),
            session.clone(),
            trace.clone(),
            is_support_restore_token,
            capture_cursor,
        ),
        trace.clone(),
        PortalStage::CreateSession,
    )
    .map_err(|e| anyhow!(dbus_stage_err("create-session", &e)))?;
    if is_server_running() {
        let _ = screencast_portal::create_session(&portal, args)
            .map_err(|e| anyhow!(dbus_stage_err("create-session", &e)))?;
    } else {
        let _ = remote_desktop_portal::create_session(&portal, args)
            .map_err(|e| anyhow!(dbus_stage_err("create-session", &e)))?;

View on GitHub (pinned to 91c9fccbb0)

Solutions

  1. Retry the whole request_remote_desktop flow — transient bus failures resolve after reconnect.
  2. Restart the D-Bus session daemon if it was reloaded during the call.
  3. Verify the session bus is dbus-daemon or dbus-broker with normal unique-name behavior.
  4. Update zbus/rustdesk version if get_request_path fails against a newer bus implementation.
Defensive patterns

Strategy: retry

Try / catch

match get_capturables() {
    Err(e) if e.to_string().contains("create-session") => {
        // transient bus failure: reconnect and retry once
        std::thread::sleep(Duration::from_millis(500));
        get_capturables()
    }
    r => r,
}

Prevention

When it happens

Trigger: request_remote_desktop calls get_request_path(&conn, create_session_handle_token) and the underlying unique name / token extraction fails (e.g. malformed unique bus name, bus connection degraded).

Common situations: D-Bus daemon restarted mid-call, unusual bus implementations (dbus-broker quirks), or connection established but unique name unavailable.

Related errors


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