{"record":{"id":"9c2155b5d0fcf856","repo":"jackwener/OpenCLI","slug":"failed-to-open-notebooklm-notebook-notebookid-9c2155","errorCode":null,"errorMessage":"Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}","messagePattern":"Failed to open NotebookLM notebook (.+?): (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/generate-slides.js","lineNumber":83,"sourceCode":"    navigateBefore: false,\n    args: [\n        { name: 'notebook', positional: true, required: true, help: 'Notebook id from `notebooklm list` or full notebook URL' },\n        { name: 'length', help: 'Slide deck length: 1=Short, 3=Default (default 3)' },\n        { name: 'language', help: 'Language code (default en)' },\n        { name: 'execute', type: 'boolean', help: 'Actually trigger remote NotebookLM slide deck generation' },\n    ],\n    columns: ['notebook_id', 'slides_id', 'source_count', 'status', 'notebook_url'],\n    func: async (page, kwargs) => {\n        const notebookId = parseNotebooklmNotebookTarget(String(kwargs.notebook ?? ''));\n        const length = parseSlideDeckLength(kwargs.length);\n        const language = String(kwargs.language ?? 'en').trim() || 'en';\n        requireNotebooklmExecute(kwargs.execute, 'generate NotebookLM slides');\n        try {\n            await page.goto(buildNotebooklmNotebookUrl(notebookId));\n            await page.wait(2);\n        }\n        catch (error) {\n            throw new CommandExecutionError(`Failed to open NotebookLM notebook ${notebookId}: ${error?.message || error}`);\n        }\n        await requireNotebooklmSession(page);\n        const sources = await listNotebooklmSourcesViaRpc(page);\n        const sourceIds = sources.map((s) => s.id).filter((id) => typeof id === 'string' && id);\n        if (sourceIds.length === 0) {\n            throw new EmptyResultError('notebooklm generate-slides', 'The notebook has no sources; add a source before generating a slide deck.');\n        }\n        const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_CREATE_ARTIFACT_RPC_ID, buildCreateSlidesArgs(notebookId, sourceIds, { length, language }));\n        const slidesId = parseSlidesIdFromResult(rpc.result, [notebookId, ...sourceIds]);\n        if (!slidesId) {\n            throw new CommandExecutionError('NotebookLM CreateArtifact (slides) RPC returned no slide-deck id; the server may have rejected the request.');\n        }\n        return [{\n            notebook_id: notebookId,\n            slides_id: slidesId,\n            source_count: sourceIds.length,\n            status: 'pending',\n            notebook_url: buildNotebooklmNotebookUrl(notebookId),","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/generate-slides.js#L65-L101","documentation":"This CommandExecutionError wraps any failure while navigating the adapter page to the notebook URL during `notebooklm generate-slides`. Like the audio variant, it decorates the underlying goto/wait error with the notebookId for debuggability.","triggerScenarios":"`page.goto(buildNotebooklmNotebookUrl(notebookId))` or the subsequent wait throws — bad notebookId, expired session redirecting to login, network timeout, or dead browser tab.","commonSituations":"Notebook deleted or id mistyped so the URL 404s; NotebookLM session cookies expired; corporate proxy blocking the request.","solutions":["Verify the notebookId (use `opencli notebooklm list` or `current`) and fix typos.","Re-authenticate / refresh the NotebookLM session, then retry.","Check network/proxy availability and that the adapter browser session is running."],"exampleFix":"// before\nopencli notebooklm generate-slides --notebook wrong-id\n// after\nopencli notebooklm current   # confirm id\nopencli notebooklm generate-slides --notebook correct-id --length 3","handlingStrategy":"try-catch","validationCode":"if (!notebookId || typeof notebookId !== 'string') throw new Error('notebookId required');\nconst notebooks = await runCli(['notebooklm', 'list']);\nif (!notebooks.some((n) => n.id === notebookId)) throw new Error(`unknown notebookId: ${notebookId}`);","typeGuard":"const isValidNotebookId = (id) => typeof id === 'string' && id.trim().length > 0;","tryCatchPattern":"try {\n  await generateSlides({ notebookId, length });\n} catch (e) {\n  if (String(e.message).startsWith('Failed to open NotebookLM notebook')) {\n    await refreshNotebooklmSession();\n    return await generateSlides({ notebookId, length });\n  }\n  throw e;\n}","preventionTips":["Resolve the notebook id from `notebooklm list`/`current` instead of hardcoding.","Refresh session auth before batch generation runs.","Check connectivity/proxy settings before automation."],"tags":["notebooklm","navigation","command-execution","network"],"backgroundTag":"page-navigation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}