{"record":{"id":"5521237c1af7347b","repo":"Stirling-Tools/Stirling-PDF","slug":"cannot-resolve-server-address-please-check-the-se","errorCode":null,"errorMessage":"Cannot resolve server address. Please check the server URL is correct.","messagePattern":"Cannot resolve server address\\. Please check the server URL is correct\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/editor/src/desktop/services/authService.ts","lineNumber":453,"sourceCode":"        // Timeout\n        else if (errMsg.includes(\"timeout\") || errMsg.includes(\"timed out\")) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"Login request timed out. Please check your network connection and try again.\",\n            {\n              cause: error,\n            },\n          );\n        }\n        // DNS failure\n        else if (\n          errMsg.includes(\"getaddrinfo\") ||\n          errMsg.includes(\"dns\") ||\n          errMsg.includes(\"not found\") ||\n          errMsg.includes(\"enotfound\")\n        ) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"Cannot resolve server address. Please check the server URL is correct.\",\n            { cause: error },\n          );\n        }\n        // SSL/TLS errors\n        else if (\n          errMsg.includes(\"ssl\") ||\n          errMsg.includes(\"tls\") ||\n          errMsg.includes(\"certificate\") ||\n          errMsg.includes(\"cert\")\n        ) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"SSL/TLS certificate error. Server may have an invalid or self-signed certificate.\",\n            {\n              cause: error,\n            },\n          );","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/frontend/editor/src/desktop/services/authService.ts#L435-L471","documentation":"Thrown when the login error message contains 'getaddrinfo', 'dns', 'not found', or 'enotfound'. DNS resolution for the server hostname failed — the name does not resolve to an address. Original error preserved as cause; auth resets to unauthenticated.","triggerScenarios":"The server URL host cannot be resolved: a typo in the hostname, an internal-only DNS name used from outside the VPN, a split-horizon DNS mismatch, or the resolver being unreachable.","commonSituations":"User typed the server's internal Docker hostname instead of the host machine's address; private hostname only resolvable on the corporate LAN but the desktop is remote; custom DNS server misconfigured or down.","solutions":["Double-check the hostname spelling in the server URL.","Ensure the desktop is on the network where the hostname resolves (VPN connected for corporate hosts).","Try resolving the host (nslookup/dig) from the desktop; if it fails, fix DNS or use an IP address.","For LAN hosts, confirm mDNS / local DNS is publishing the name."],"exampleFix":"// before: user enters internal-only name from outside the LAN\n//   http://stirling.internal:8080\n// after: preflight DNS check with a helpful hint\nconst resolved = await canResolve(new URL(serverUrl).hostname);\nif (!resolved) { hint('That hostname does not resolve from here — check it or connect to the LAN/VPN.'); return; }\nawait authService.login(serverUrl, user, pass);","handlingStrategy":"validation","validationCode":"// preflight hostname resolution hint\nasync function canResolve(host: string): Promise<boolean> {\n  try { await fetch(`https://${host}/api/v1/info`, { method: 'HEAD', signal: AbortSignal.timeout(3000) }); return true; }\n  catch (e) { return !/ENOTFOUND|getaddrinfo|dns/i.test(String(e)); }\n}","typeGuard":"function isDnsFailure(e: unknown): e is Error {\n  return e instanceof Error && /Cannot resolve server address/.test(e.message);\n}","tryCatchPattern":"try { await authService.login(serverUrl, user, pass); }\ncatch (e) {\n  if (isDnsFailure(e)) { show('That hostname does not resolve — check it or connect to the LAN/VPN.'); return; }\n  throw e;\n}","preventionTips":["Normalize/validate the server URL (new URL()) before login.","For corporate hosts, remind users to connect to VPN first.","Suggest the IP address as a fallback when DNS is unavailable."],"tags":["network","dns","server-config","desktop"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}