Ob sync-setup fails on headless Linux (keychain unavailable)

Hi,

Tried out the headless obsidian cli today

Environment:

• OS: Ubuntu 24.04 (headless VPS, no GUI)
• obsidian-headless v1.0.0
• Node.js v22.22.0

Steps to reproduce:

  1. Install obsidian-headless on a headless Linux server
  2. Set OBSIDIAN_AUTH_TOKEN env var (bypassing ob login)
  3. Run ob sync-setup --vault “My Vault”

Error:

Setup failed: Failed to store key in keychain: Error: Error calling
StartServiceByName for org.freedesktop.secrets: Timeout was reached

Root cause:
ob sync-setup stores the vault encryption key via keytar (libsecret), which requires a running D-Bus session + gnome-keyring. These are unavailable on headless servers.

OBSIDIAN_AUTH_TOKEN successfully bypasses keychain for authentication, but there is no equivalent env var or flag to bypass keychain for the vault encryption key stored during sync-setup.

Expected behavior:
Either a fallback to file-based storage (similar to OBSIDIAN_AUTH_TOKEN), or a --key / OBSIDIAN_VAULT_KEY env var option for non-interactive environments.

Workaround:
Manually start gnome-keyring-daemon with DBUS_SESSION_BUS_ADDRESS set before running ob sync-setup.

2 Likes

Than you, we will revisit this.

I think this is good now? I was also running into this, but I’m now able to ob login / ob sync with an encrypted vault just fine!

A new version (0.0.3) was released to address this issue.

1 Like