Skip to content

fix: use snap-accessible profile directory for snap-installed browsers#195

Merged
jacob-bd merged 1 commit into
jacob-bd:mainfrom
ildella:fix/snap-chromium-profile
May 22, 2026
Merged

fix: use snap-accessible profile directory for snap-installed browsers#195
jacob-bd merged 1 commit into
jacob-bd:mainfrom
ildella:fix/snap-chromium-profile

Conversation

@ildella
Copy link
Copy Markdown
Contributor

@ildella ildella commented May 21, 2026

Problem

On Ubuntu (and other distros), Chromium is often installed as a Snap package with AppArmor confinement. Snap apps can only write to ~/snap/<snap-name>/common/, so launching Chromium with --user-data-dir=~/.notebooklm-mcp-cli/ fails with:

Exit code 21: Failed to create a ProcessSingleton for your profile directory

Solution

  • Detect snap browsers via /snap/ in resolved binary path
  • Use ~/snap/chromium/common/notebooklm-mcp-cli/chrome-profiles/ as profile directory for snap browsers
  • Return full path from shutil.which() (required for snap detection)
  • Update profile lock, headless auth, and cache cleanup to be snap-aware

Changes

File Lines Purpose
src/notebooklm_tools/utils/cdp.py +170/-34 Snap detection, profile dir selection, full path from which()
src/notebooklm_tools/utils/config.py +36 get_snap_chrome_profile_dir() function
tests/test_auth_migration.py +4/-5 Update tests for full path behavior

Testing

  • All 843 tests pass
  • Verified nlm login --chrome works with snap Chromium on Ubuntu 25.10

On Ubuntu (and other distros), Chromium is often installed as a Snap
package with AppArmor confinement. Snap apps can only write to
~/snap/<snap-name>/common/, so launching Chromium with
--user-data-dir=~/.notebooklm-mcp-cli/ fails with exit code 21
(ProcessSingleton error).

Changes:
- Return full path from shutil.which() instead of just executable name
  (required for snap detection)
- Detect snap browsers via /snap/ in resolved binary path
- Use ~/snap/chromium/common/notebooklm-mcp-cli/chrome-profiles/ as
  profile directory for snap browsers
- Update profile lock, headless auth, and cache cleanup to be snap-aware
@jacob-bd jacob-bd merged commit febfb0f into jacob-bd:main May 22, 2026
@jacob-bd
Copy link
Copy Markdown
Owner

Hey Daniele, thanks for submitting the PR! It's been merged and will be included in the next release. Appreciate the contribution, bro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants