Stirling-Tools/Stirling-PDF · error · Error

Login request timed out. Please check your network connectio

Error message

Login request timed out. Please check your network connection and try again.

What it means

Thrown when the login error message contains 'timeout' or 'timed out'. The request was sent but no response arrived within the deadline — the network is slow, lossy, or the server is overloaded/stalled. Original error preserved as cause; auth resets to unauthenticated.

Source

Thrown at frontend/editor/src/desktop/services/authService.ts:438

          );
        }
        // Server not found or unreachable
        else if (
          errMsg.includes("connection refused") ||
          errMsg.includes("econnrefused")
        ) {
          this.setAuthStatus("unauthenticated", null);
          throw new Error(
            "Cannot connect to server. Please check the server URL and ensure the server is running.",
            {
              cause: error,
            },
          );
        }
        // Timeout
        else if (errMsg.includes("timeout") || errMsg.includes("timed out")) {
          this.setAuthStatus("unauthenticated", null);
          throw new Error(
            "Login request timed out. Please check your network connection and try again.",
            {
              cause: error,
            },
          );
        }
        // DNS failure
        else if (
          errMsg.includes("getaddrinfo") ||
          errMsg.includes("dns") ||
          errMsg.includes("not found") ||
          errMsg.includes("enotfound")
        ) {
          this.setAuthStatus("unauthenticated", null);
          throw new Error(
            "Cannot resolve server address. Please check the server URL is correct.",
            { cause: error },
          );

View on GitHub (pinned to 9ef20dcab8)

Solutions

  1. Retry the login once (transient network slowness often clears).
  2. Move to a more stable/faster network connection.
  3. Check the server's responsiveness directly (curl the /login endpoint) and increase server capacity if it is overloaded.
  4. If behind a proxy, raise the proxy's upstream read/connect timeouts to exceed Stirling's response time.

Example fix

// before: single attempt, no retry
await authService.login(server, user, pass);

// after: retry once on timeout
try { await authService.login(server, user, pass); }
catch (e) {
  if (e instanceof Error && /timed out/i.test(e.message)) {
    show('Network slow — retrying…');
    await authService.login(server, user, pass);
    return;
  }
  throw e;
}
Defensive patterns

Strategy: retry

Validate before calling

// estimate link health before login
if (navigator.onLine === false) { show('You are offline.'); return; }

Type guard

function isLoginTimeout(e: unknown): e is Error {
  return e instanceof Error && /timed out/i.test(e.message);
}

Try / catch

async function loginWithRetry(...args: Parameters<typeof authService.login>) {
  try { return await authService.login(...args); }
  catch (e) {
    if (isLoginTimeout(e)) { show('Network slow — retrying…'); return await authService.login(...args); }
    throw e;
  }
}

Prevention

When it happens

Trigger: The Rust login invoke's HTTP request exceeds its timeout: server under heavy load, a saturated/high-latency link, a reverse proxy with a short upstream timeout, or packet loss causing TCP retransmits.

Common situations: User on a congested VPN or mobile hotspot; server doing a long blocking operation (e.g. Supabase cold start) that exceeds the client deadline; intermediate proxy/load balancer timing out before Stirling responds.

Understand the failure class

Related errors


AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13). Data as JSON: /api/errors/4b0eac863faa38c7. Report an issue: GitHub.