{"record":{"id":"6b35adaafd879062","repo":"CloakHQ/CloakBrowser","slug":"geoip-resolution-failed-could-not-determine-mis","errorCode":null,"errorMessage":"GeoIP resolution failed: could not determine ${missing.join(\" and \")}","messagePattern":"GeoIP resolution failed: could not determine (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"js/src/geoip.ts","lineNumber":484,"sourceCode":"  // When both tz/locale are explicit, resolve the exit IP for WebRTC — but only\n  // with a proxy. With no proxy the WebRTC IP would just be the real connection\n  // IP the site already sees (a no-op), so skip the third-party echo call.\n  if (timezone && locale) {\n    if (!proxyUrl) return { timezone, locale };\n    const timeoutMs = getGeoipTimeoutMs();\n    const exitIp = await resolveExitIp(proxyUrl, timeoutMs) ?? undefined;\n    return { timezone, locale, exitIp };\n  }\n\n  const { timezone: geoTz, locale: geoLocale, exitIp: geoExitIp } = await resolveProxyGeo(proxyUrl);\n  const resolvedTimezone = timezone ?? geoTz ?? undefined;\n  const resolvedLocale = locale ?? geoLocale ?? undefined;\n  const missing = [\n    resolvedTimezone ? null : \"timezone\",\n    resolvedLocale ? null : \"locale\",\n  ].filter((value): value is string => value !== null);\n  if (missing.length > 0) {\n    throw new Error(`GeoIP resolution failed: could not determine ${missing.join(\" and \")}`);\n  }\n  return {\n    timezone: resolvedTimezone,\n    locale: resolvedLocale,\n    exitIp: geoExitIp ?? undefined,\n  };\n}\n\n/**\n * Append `--fingerprint-webrtc-ip=<exitIp>` unless the user already set the flag.\n * The exit IP comes free from the geoip lookup; it spoofs the WebRTC IP to the\n * egress IP. No-op when there is no exit IP or the flag is already present. This\n * rule must stay identical across every launch path, so it lives in one place.\n */\nexport function appendWebrtcExitIp(\n  args: string[] | undefined,\n  exitIp: string | undefined,\n): string[] | undefined {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/geoip.ts#L466-L502","documentation":"maybeResolveGeoip finished but could not determine one or both of timezone and locale: neither the caller-supplied values nor the GeoIP result produced them. The message names exactly which fields are missing.","triggerScenarios":"Calling maybeResolveGeoip without timezone/locale while the GeoIP lookup returned a country with no entry in COUNTRY_LOCALE_MAP (locale missing), or the reader result lacked a timezone field; also when GeoIP was skipped and no explicit values were given.","commonSituations":"Exotic IPs (satellite/VPN providers) with sparse MaxMind data, countries not covered by the locale map, or callers assuming GeoIP always succeeds and omitting explicit timezone/locale options.","solutions":["Pass explicit timezone and locale when you know them (they take precedence and bypass the error)","Update or extend COUNTRY_LOCALE_MAP / use a newer GeoIP database covering the exit IP","If locale cannot be inferred, default it (e.g. 'en-US') instead of failing"],"exampleFix":"// before\nconst { timezone, locale } = await maybeResolveGeoip({ ip, dbPath });\n\n// after\nconst { timezone, locale } = await maybeResolveGeoip({\n  ip,\n  dbPath,\n  timezone: 'America/New_York', // known ahead of time\n  locale: 'en-US',\n});","handlingStrategy":"fallback","validationCode":"const desired = { timezone: 'America/New_York', locale: 'en-US' };\nconst needGeoip = !desired.timezone || !desired.locale;\nif (!needGeoip) { /* skip maybeResolveGeoip entirely */ }","typeGuard":"function missingGeoFields(e: unknown): string[] | null {\n  if (!(e instanceof Error)) return null;\n  const m = e.message.match(/could not determine (.+)$/);\n  return m ? m[1].split(' and ') : null;\n}","tryCatchPattern":"try { return await maybeResolveGeoip(opts); }\ncatch (e) {\n  const missing = missingGeoFields(e);\n  if (missing) {\n    return { timezone: opts.timezone ?? 'UTC', locale: opts.locale ?? 'en-US', exitIp: undefined };\n  }\n  throw e;\n}","preventionTips":["Pass known timezone/locale explicitly whenever available","Default locale before calling so only genuinely unknown fields rely on GeoIP","Treat GeoIP as best-effort: catch and degrade rather than fail the session"],"tags":["geoip","locale","timezone","missing-data"],"backgroundTag":"geoip-locale-timezone-unresolved","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}