Account sync scheduler fires before Fava client init at LNbits startup #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
On LNbits cold start, the libra extension logs an
ERROR-level line within a couple hundred ms of boot:Observed on
aio-demo2026-05-22 after a routine LNbits restart. Same pattern on other castle hosts I'd assume — it's a startup-ordering bug, not host-specific.Diagnosis
Two startup paths race:
t=0againstinit_fava_client()-uninitialized state.The first scheduled tick loses the race; subsequent ticks (one hour later, then hourly) succeed because Fava is ready by then.
Impact
Cosmetic in production — the next tick recovers. But it logs two
ERROR-level lines on every boot, which:ERROR | [LIBRA].Fix options (cheapest first)
fava_client is None, sleep until init or skip this tick gracefully (downgrade toINFOorWARNING).I'd lean (2) — it's defensive against any future race and downgrades the log level appropriately. (1) is the minimum viable fix if (2) is hard to reach.
Out of scope