{"record":{"id":"184ebe19293c4a19","repo":"jackwener/OpenCLI","slug":"failed-to-open-notebooklm-home-error-message","errorCode":null,"errorMessage":"Failed to open NotebookLM home: ${error?.message || error}","messagePattern":"Failed to open NotebookLM home: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/utils.js","lineNumber":638,"sourceCode":"    return parseNotebooklmVisibleNoteRawRow(raw, state.notebookId, state.url || `https://${NOTEBOOKLM_DOMAIN}/notebook/${state.notebookId}`);\n}\nexport async function ensureNotebooklmHome(page) {\n    const currentUrl = page.getCurrentUrl\n        ? await page.getCurrentUrl().catch(() => null)\n        : null;\n    const currentKind = currentUrl ? classifyNotebooklmPage(currentUrl) : 'unknown';\n    if (currentKind === 'home')\n        return;\n    const authuser = getNotebooklmAuthuser();\n    const current = parseTrustedNotebooklmUrl(currentUrl);\n    const home = current ? `${current.origin}/` : NOTEBOOKLM_HOME_URL;\n    const target = authuser ? `${home}?authuser=${encodeURIComponent(authuser)}` : home;\n    try {\n        await page.goto(target);\n        await page.wait(2);\n    }\n    catch (error) {\n        throw new CommandExecutionError(`Failed to open NotebookLM home: ${error?.message || error}`);\n    }\n}\nexport async function getNotebooklmPageState(page) {\n    const raw = await evaluateNotebooklm(page, `(() => {\n    const url = window.location.href;\n    const title = document.title || '';\n    const hostname = window.location.hostname || '';\n    const notebookMatch = url.match(/\\\\/notebook\\\\/([^/?#]+)/);\n    const notebookId = notebookMatch ? notebookMatch[1] : '';\n    const path = window.location.pathname || '/';\n    const kind = notebookId\n      ? 'notebook'\n      : (hostname === 'notebooklm.google.com' || hostname === 'notebook.google.com' ? 'home' : 'unknown');\n\n    const textNodes = Array.from(document.querySelectorAll('a, button, [role=\"button\"], h1, h2'))\n      .map(node => (node.textContent || '').trim().toLowerCase())\n      .filter(Boolean);\n    const loginRequired = path === '/login' || path.startsWith('/login/') || textNodes.some(text =>","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/utils.js#L620-L656","documentation":"openNotebooklmHome (or equivalent) navigates the browser page to the NotebookLM home URL (optionally with authuser param) and waits; if page.goto or the wait throws, the error is wrapped into this CommandExecutionError. It means the Browser Bridge could not even load the NotebookLM home page, so no subsequent RPC or scraping can proceed.","triggerScenarios":"page.goto(target) fails — network outage/DNS failure, NotebookLM unreachable, browser closed or crashed, invalid authuser parameter, or the wait-after-navigation throwing because the page context died.","commonSituations":"No internet or corporate proxy blocking notebooklm.google.com; headless browser not launched or already closed; wrong Google account/authuser suffix causing a redirect loop; transient 5xx from Google.","solutions":["Check network connectivity and that https://notebooklm.google.com loads in a normal browser","Ensure the browser/page is launched and healthy before navigation (recreate the page if closed)","Verify the authuser value is a valid index for the signed-in accounts","Retry the navigation — Google endpoints occasionally return transient errors","Check proxy/VPN/firewall settings if running in a restricted environment"],"exampleFix":"// before\nawait openNotebooklmHome(page);\n// after: pre-check and retry\nfor (let i = 0; i < 3; i++) {\n  try { await openNotebooklmHome(page, authuser); break; }\n  catch (e) {\n    if (!/Failed to open NotebookLM home/.test(e.message) || i === 2) throw e;\n    await new Promise((r) => setTimeout(r, 2000));\n  }\n}","handlingStrategy":"retry","validationCode":"// pre-flight: ensure the home URL is reachable\nconst res = await fetch('https://notebooklm.google.com/').catch(() => null);\nif (!res || !res.ok) throw new Error('NotebookLM unreachable; fix network before opening page');","typeGuard":"function isNavigationFailure(e) {\n  return /Failed to open NotebookLM home/.test(String(e?.message));\n}","tryCatchPattern":"try {\n  await openNotebooklmHome(page, authuser);\n} catch (e) {\n  if (!isNavigationFailure(e)) throw e;\n  await new Promise((r) => setTimeout(r, 2000));\n  await openNotebooklmHome(page, authuser); // retry transient navigation errors\n}","preventionTips":["Pre-flight check connectivity to notebooklm.google.com","Recreate the browser page if it was closed/crashed before navigating","Validate authuser is a valid signed-in account index","Configure proxy/VPN exceptions for Google domains in CI environments","Add waits between navigation and subsequent probes"],"tags":["notebooklm","navigation","browser-bridge","network"],"backgroundTag":"page-navigation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}