CloakHQ/CloakBrowser · warning

[cloakbrowser] Using cached license validation (server unrea

Error message

[cloakbrowser] Using cached license validation (server unreachable)

What it means

This is a console.warn, not a thrown error: license validation could not reach the validation server (network failure, DNS, timeout, or server outage), so the library falls back to the last cached validation result. It exists so offline usage still works while signaling that freshness could not be guaranteed. If no stale cache exists, validateLicense returns null and the caller sees a normal license failure.

Source

Thrown at js/src/license.ts:519

    const info: LicenseInfo = {
      valid: Boolean(data.valid ?? false),
      plan: String(data.plan ?? "solo"),
      expires: data.expires != null ? String(data.expires) : null,
    };

    if (info.valid) {
      writeCache(cachePath, keySha, info);
    }
    return info;
  } catch (e) {
    console.warn(
      `[cloakbrowser] License validation request failed: ${e instanceof Error ? e.message : e}`
    );

    // Fall back to stale cache
    const stale = readCache(cachePath, keySha, true);
    if (stale) {
      console.warn("[cloakbrowser] Using cached license validation (server unreachable)");
      return stale;
    }

    return null;
  }
}

/** Get the server-resolved Pro release and channel for this platform. */
export async function getProLatestRelease(releaseChannel?: string): Promise<ProReleaseInfo | null> {
  const channel = normalizeReleaseChannel(releaseChannel);
  const markerSuffix = channel === "preview"
    ? `preview_${getPlatformTag()}`
    : getPlatformTag();
  const marker = path.join(getCacheDir(), `.last_pro_version_check_${markerSuffix}`);
  const resolutionMarker = path.join(
    getCacheDir(),
    `.last_pro_version_resolution_${markerSuffix}`,
  );

View on GitHub (pinned to d6bad5de26)

Solutions

  1. Restore network connectivity or fix proxy/firewall rules so the license server is reachable, then re-run to refresh the cache.
  2. If running in CI/offline by design, perform one online validation to populate the cache before going offline.
  3. Delete the stale cache file (path from cachePath) to force a fresh validation once back online, confirming the cached license is still valid.
  4. Check for a license-server status page or library update if the outage persists.

Example fix

// before: launch offline, relies on stale cache
await cloakbrowser.launchPersistentContext('./profile');

// after: validate online once, cache refreshed, warning gone
const result = await cloakbrowser.validateLicense();
if (!result) throw new Error('license invalid');
await cloakbrowser.launchPersistentContext('./profile');
Defensive patterns

Strategy: retry

Validate before calling

// probe connectivity before launching
import { setTimeout as sleep } from 'timers/promises';
async function isLicenseServerReachable(): Promise<boolean> {
  try {
    const res = await fetch('https://license.cloakbrowser.example/health', {
      signal: AbortSignal.timeout(5000),
    });
    return res.ok;
  } catch { return false; }
}
const online = await isLicenseServerReachable();
if (!online) console.warn('expect stale-cache license validation');

Try / catch

// validateLicense returns null rather than throwing on network failure — treat null as fatal
const result = await cloakbrowser.validateLicense();
if (!result) throw new Error('No license and no cached validation available');

Prevention

When it happens

Trigger: Calling validateLicense() (directly or via launch, which validates the license) while the machine has no internet, a firewall blocks the license endpoint, DNS fails, or the license server is down — and a previous successful validation was cached on disk.

Common situations: CI runners without network access, corporate proxies blocking the endpoint, temporary server outages, expired-cache TTL after long offline periods. If the cache is expired/missing the same network condition produces a hard license failure instead.

Related errors


AI-assisted analysis of CloakHQ/CloakBrowser@d6bad5de26 (2026-08-28). Data as JSON: /api/errors/928a2eb0315861cb. Report an issue: GitHub.