CloakHQ/CloakBrowser · info

[cloakbrowser] Existing Widevine hint unreadable; rewriting

Error message

[cloakbrowser] Existing Widevine hint unreadable; rewriting

What it means

The Widevine hint file already exists in the profile but readFileSync failed or its comparison threw (permissions issue, corrupted file, disk error), so the library discards it and rewrites the hint file from scratch. This is self-healing; the write immediately follows and launch is never blocked.

Source

Thrown at js/src/widevine.ts:119

          "[cloakbrowser] CLOAKBROWSER_WIDEVINE_CDM is set but has no manifest.json; " +
            "skipping Widevine hint seeding",
        );
      }
      return;
    }

    const hintDir = path.join(userDataDir, "WidevineCdm");
    fs.mkdirSync(hintDir, { recursive: true });
    const hintFile = path.join(hintDir, HINT_FILENAME);
    // cdmDir is already absolute/resolved.
    const content = JSON.stringify({ Path: cdmDir });

    try {
      if (isFile(hintFile) && fs.readFileSync(hintFile, "utf-8") === content) {
        return; // already seeded correctly
      }
    } catch {
      console.warn("[cloakbrowser] Existing Widevine hint unreadable; rewriting");
    }
    fs.writeFileSync(hintFile, content);
  } catch (e) {
    // Best-effort: never break the launch, but surface the failure.
    console.warn("[cloakbrowser] Failed to seed Widevine CDM hint file:", e);
  }
}

View on GitHub (pinned to d6bad5de26)

Solutions

  1. Check permissions on the profile dir and hint file: ensure the process user can read/write (chmod/chown on the profile directory).
  2. Avoid sharing one profile directory between concurrent browser instances.
  3. If the profile is disposable, delete it and let CloakBrowser recreate it cleanly.
  4. The warning is harmless if launch succeeds and DRM playback works — no action strictly required.
Defensive patterns

Strategy: fallback

Validate before calling

import fs from 'node:fs';
function hintReadable(hintFile: string): boolean {
  try { fs.readFileSync(hintFile, 'utf-8'); return true; } catch { return false; }
}
// repair before launch
if (!hintReadable(`${profileDir}/WidevineCdm/latest.component`)) {
  fs.rmSync(profileDir, { recursive: true, force: true });
}

Prevention

When it happens

Trigger: A previous profile where the Widevine hint file became unreadable — bad file permissions after copying a profile between machines/users/containers, a truncated file from an interrupted run, or antivirus/EDR locking the file on Windows.

Common situations: Copying or shipping a persistent-context profile directory between environments with different UID/permissions; concurrent browser instances touching the same profile; disk-full events truncating files.

Related errors


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