jackwener/OpenCLI · error · CommandExecutionError

NotebookLM AddSources RPC returned no source id; verify the

Error message

NotebookLM AddSources RPC returned no source id; verify the input reaches the NotebookLM backend.

What it means

The AddSources RPC (used for --url and --content source creation) returned a response from which no new source id could be parsed. The library throws this CommandExecutionError because it cannot verify the source was added without an id. The message hints the input may not have reached the backend.

Source

Thrown at clis/notebooklm/add-source.js:246

                throw new CommandExecutionError('NotebookLM AddFileSource (o4cbdc) RPC returned no source id; cannot start file upload.');
            }
            await uploadFileViaDriveResumable(page, notebookId, sourceId, file.filename, file.base64, file.size);
            await verifyNotebooklmSourceAdded(page, notebookId, sourceId, 'add-source --file');
            return [{
                notebook_id: notebookId,
                source_id: sourceId,
                kind: 'file',
                identifier: `${file.filename} (${mime}, ${file.size} bytes)`,
                notebook_url: buildNotebooklmNotebookUrl(notebookId),
            }];
        }
        const args = url
            ? buildAddSourceFromUrlArgs(notebookId, url)
            : buildAddSourceFromTextArgs(notebookId, title, content);
        const rpc = await callNotebooklmRpc(page, NOTEBOOKLM_ADD_SOURCES_RPC_ID, args);
        const sourceId = parseAddSourceResult(rpc.result, [notebookId]);
        if (!sourceId) {
            throw new CommandExecutionError('NotebookLM AddSources RPC returned no source id; verify the input reaches the NotebookLM backend.');
        }
        await verifyNotebooklmSourceAdded(page, notebookId, sourceId, `add-source --${url ? 'url' : 'content'}`);
        return [{
            notebook_id: notebookId,
            source_id: sourceId,
            kind: url ? 'url' : 'text',
            identifier: url || title,
            notebook_url: buildNotebooklmNotebookUrl(notebookId),
        }];
    },
});

export const __test__ = {
    parseSourceUrl,
    parseSourceText,
    parseSourceTitle,
    inferMimeType,
    buildAddSourceFromUrlArgs,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Refresh the NotebookLM session/auth and retry the command.
  2. Test with a simple plain-text --content to isolate whether URLs or the RPC pipeline are the problem.
  3. Verify in the NotebookLM web UI whether the source was actually created despite the missing id.
  4. Log the raw rpc.result and check for an error payload or changed schema from the backend.
Defensive patterns

Strategy: try-catch

Validate before calling

if (url && !/^https?:\/\//.test(url)) throw new Error('URL must start with http(s)://');
if (content && content.length > 1_000_000) console.warn('Content is very large; may be rejected');

Try / catch

try {
  await addSource({ content: text });
} catch (e) {
  if (String(e.message).includes('returned no source id')) {
    await refreshAuth();
    return addSource({ content: text }); // one retry
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `add-source --url <url>` or `add-source --content <text>` where the AddSources RPC resolves but parseAddSourceResult finds no id besides the notebook id in the result.

Common situations: Submitting a URL that Google refuses to fetch (paywalled, blocked); NotebookLM session expired so the RPC is a soft failure; very long content truncated; upstream response format changed.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/d2b8840ece2324d8. Report an issue: GitHub.