Skip to content

fix: Lightning tab never loads with LND backend (wrong macaroon path)#56

Merged
MattDHill merged 1 commit into
masterfrom
fix/lnd-macaroon-path
Jun 6, 2026
Merged

fix: Lightning tab never loads with LND backend (wrong macaroon path)#56
MattDHill merged 1 commit into
masterfrom
fix/lnd-macaroon-path

Conversation

@helix-nine
Copy link
Copy Markdown
Contributor

Problem

Multiple users report Mempool's Lightning tab stays in a perpetual loading state with a healthy LND running and selected on default settings.

Root cause

LND (lnd-startos) stores its macaroons under data/chain/bitcoin/mainnet/ inside its main volume — the same layout lnd-startos's own interfaces.ts reads from (/media/startos/volumes/main/data/chain/bitcoin/mainnet/admin.macaroon). The tls.cert, by contrast, is written at the volume root.

Mempool mounts LND's main volume at /mnt/lnd but pointed MACAROON_PATH at the volume root:

File was actual location
tls.cert /mnt/lnd/tls.cert volume root — correct
readonly.macaroon /mnt/lnd/readonly.macaroon /mnt/lnd/data/chain/bitcoin/mainnet/readonly.macaroon

The backend couldn't read the macaroon, so the LND REST connection never initialized and the Lightning tab loaded forever.

CLN was checked and is correct (<main>/bitcoin/lightning-rpc, mounted via subpath bitcoin) — this was an LND-only bug.

Fix

  • Centralize the LND cert/macaroon paths in utils.ts (lndCertPath, lndMacaroonPath) and point the macaroon at the real data/chain/bitcoin/mainnet/readonly.macaroon path.
  • Use those constants in both the config file model (enforced z.literal) and the enable-lightning action.

Existing installs

Self-heal on the first start after upgrade: MACAROON_PATH is an enforced z.literal(...).catch(...), so a read coerces the stale path to the corrected one, and seedFiles' configJson.merge(effects, {}) (run on every non-install init) rewrites the on-disk config. No explicit migration required; the carried-forward 0.3.5.1 migration is untouched.

Release

Bumps to 3.3.1:3. Built clean for x86_64 and aarch64; tsc --noEmit passes.

MattDHill
MattDHill previously approved these changes Jun 6, 2026
@MattDHill MattDHill dismissed their stale review June 6, 2026 13:45

Merge conflicts

LND stores its macaroons under data/chain/bitcoin/mainnet/ in its main
volume, but the mempool backend was pointed at the volume root. The
backend could not read the macaroon, so the LND REST connection never
initialized and the Lightning tab loaded forever.

Existing installs self-heal on next start: MACAROON_PATH is an enforced
z.literal whose .catch coerces the stale path, and seedFiles' merge({})
rewrites the on-disk config. Bumps to 3.3.1:11.
@helix-nine helix-nine force-pushed the fix/lnd-macaroon-path branch from 91f6069 to af5ee9d Compare June 6, 2026 13:48
@helix-nine
Copy link
Copy Markdown
Contributor Author

Rebased onto master — the conflict was from the versions/ layout changing under me (you switched to the current.ts strategy and v3.3.1_3.ts now exists on master at :3).

Reworked to match: dropped my old version-file rename, and the bump now edits current.ts in place to 3.3.1:11 (no migration needed, so no new other node). The actual fix is unchanged — MACAROON_PATH now points at /mnt/lnd/data/chain/bitcoin/mainnet/readonly.macaroon (LND's real macaroon location) via the new lndCertPath/lndMacaroonPath constants in utils.ts, used by both the file model and the enable-lightning action.

Verified master still has the buggy path, so this is still needed. tsc --noEmit passes and it builds clean for x86_64 + aarch64. Now MERGEABLE.

@MattDHill MattDHill merged commit 8a281ff into master Jun 6, 2026
1 check passed
@MattDHill MattDHill deleted the fix/lnd-macaroon-path branch June 6, 2026 13:50
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