Menu

1 / 5

Reading a SQLite Database With the macOS CLI Left an Empty WAL File and Tripped My Freshness Alarm

DEV Community: python·John·4 days ago
#BwJycfgJ
#devtopython#devto#dev#file#database
Reading 0:00
15s threshold

Originally published on hexisteme notes .

On 2026-11-02 at 09:00:48, the scheduled job in my agent telemetry pipeline raised F3-SOURCE-DB_UNAVAILABLE with the reason active WAL present . My first question was whether the raw archive had been lost. It had not. The next 7 ticks of the job all exited with rc=0, and the archive count rose monotonically from 10231 to 10346 over that stretch. The source database was fine. The check that read it had made a decision from the wrong evidence.

What the check was doing

The pipeline keeps a SQLite database of agent sessions, and a freshness check reads the newest ended_at from it to decide whether the data is current. The check is meant to be a passive observer. Its rejection message says so directly: "read-only observer will not create or mutate SQLite sidecars". To keep that promise it opens the database with an immutable=1 URI, so the read does not create a -wal or -shm file of its own.

That choice has a cost the code accepts on purpose.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.