{"record":{"id":"d4064e032030bfc2","repo":"CloakHQ/CloakBrowser","slug":"cloakbrowser-existing-widevine-hint-unreadable","errorCode":null,"errorMessage":"[cloakbrowser] Existing Widevine hint unreadable; rewriting","messagePattern":"\\[cloakbrowser\\] Existing Widevine hint unreadable; rewriting","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"js/src/widevine.ts","lineNumber":119,"sourceCode":"          \"[cloakbrowser] CLOAKBROWSER_WIDEVINE_CDM is set but has no manifest.json; \" +\n            \"skipping Widevine hint seeding\",\n        );\n      }\n      return;\n    }\n\n    const hintDir = path.join(userDataDir, \"WidevineCdm\");\n    fs.mkdirSync(hintDir, { recursive: true });\n    const hintFile = path.join(hintDir, HINT_FILENAME);\n    // cdmDir is already absolute/resolved.\n    const content = JSON.stringify({ Path: cdmDir });\n\n    try {\n      if (isFile(hintFile) && fs.readFileSync(hintFile, \"utf-8\") === content) {\n        return; // already seeded correctly\n      }\n    } catch {\n      console.warn(\"[cloakbrowser] Existing Widevine hint unreadable; rewriting\");\n    }\n    fs.writeFileSync(hintFile, content);\n  } catch (e) {\n    // Best-effort: never break the launch, but surface the failure.\n    console.warn(\"[cloakbrowser] Failed to seed Widevine CDM hint file:\", e);\n  }\n}\n","sourceCodeStart":101,"sourceCodeEnd":127,"githubUrl":"https://github.com/CloakHQ/CloakBrowser/blob/d6bad5de261bedf025280ace1d14e800aee13923/js/src/widevine.ts#L101-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check permissions on the profile dir and hint file: ensure the process user can read/write (chmod/chown on the profile directory).","Avoid sharing one profile directory between concurrent browser instances.","If the profile is disposable, delete it and let CloakBrowser recreate it cleanly.","The warning is harmless if launch succeeds and DRM playback works — no action strictly required."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import fs from 'node:fs';\nfunction hintReadable(hintFile: string): boolean {\n  try { fs.readFileSync(hintFile, 'utf-8'); return true; } catch { return false; }\n}\n// repair before launch\nif (!hintReadable(`${profileDir}/WidevineCdm/latest.component`)) {\n  fs.rmSync(profileDir, { recursive: true, force: true });\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't copy profile directories between users/containers without fixing ownership.","Never run two browser instances against the same persistent profile.","Treat this warning as noise only if DRM playback works; otherwise recreate the profile."],"tags":["widevine","filesystem","permissions","profile"],"backgroundTag":"file-not-readable","analyzedSha":"d6bad5de261bedf025280ace1d14e800aee13923","analyzedAt":"2026-08-28T14:13:12.918Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}