From 8ec9a1e70d7b43455c89768f27187f15d5983a38 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 20 Nov 2026 01:55:55 -0700 Subject: names restarts itself when the Lightning node's socket goes stale. "tried to zap pnk but it said names.coinos.io could not create an invoice" (Adam, 2026-11-20). bcln was recreated at 04:26Z; names has the node's socket file mounted, the mount kept pointing at the old file, and every @coinos.io LNURL invoice failed with ECONNREFUSED for four and a half hours until names was restarted by hand. The same thing cost 13 hours on 2026-11-11. The socket client now counts refused connections: after a minute of nothing but refusals (ten minutes if this process never reached the node, so a node that is down doesn't restart names in a loop) names logs it and exits, and docker's restart mounts the new socket. Only the mainnet node does this; the mutinynet one is left alone. New bridge/ln.test.js passes (4 checks), with the store and forget tests. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg --- names/server.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'names') diff --git a/names/server.js b/names/server.js index 34aae77..4d7a81c 100644 --- a/names/server.js +++ b/names/server.js @@ -310,7 +310,16 @@ function usableInvoice(pr, sat, network = null) { } catch { return false; } } -const ln = CFG.ln ? lnBackend(CFG.ln) : null; +// The node's socket file is mounted into this container; when the node is +// restarted the mount goes stale and every invoice fails until this process +// is restarted too (2026-11-12, 2026-11-20). Exit and let docker do that. +const ln = CFG.ln ? lnBackend({ + ...CFG.ln, + onDead: (e) => { + console.error(`lightning socket dead for a minute (${e.message}); exiting so the restart mounts the new one`); + process.exit(1); + }, +}) : null; // Optional mutinynet CLN — lets staging sell (play-money) hats. Nothing else // uses it: names, offers and forwards remain mainnet affairs. const lnMut = CFG.lnMut ? lnBackend(CFG.lnMut) : null; -- cgit v1.2.3