mnemon icon indicating copy to clipboard operation
mnemon copied to clipboard

--readonly recall fails with SQLite "out of memory (1)" on every query (v0.2.6, Windows)

Open HHHEEEWWW opened this issue 3 months ago • 0 comments

Summary

mnemon --readonly recall fails unconditionally on v0.2.6 (Windows amd64) with SQL logic error: out of memory (1), regardless of query text, --limit, or store size. The identical command without --readonly succeeds immediately.

Environment

  • mnemon v0.2.6 (official mnemon_0.2.6_windows_amd64.zip, SHA-256 verified)
  • Windows 11 amd64
  • Fresh default store with a single insight (~98 KB SQLite DB)

Reproduction

mnemon --data-dir %USERPROFILE%\.mnemon --store default --readonly recall "" --basic --limit 10

Observed output:

Error: query insights: SQL logic error: out of memory (1)

Also reproduces with:

  • a non-empty query (--readonly recall "mnemon" --basic --limit 10)
  • without --basic
  • with any --limit from 10 to 100000

Control (succeeds, returns results):

mnemon --data-dir %USERPROFILE%\.mnemon --store default recall "" --basic --limit 100000

Impact

dsh-mnemon v0.4.3 uses --readonly recall "" --basic as its read-only browse/metadata contract (allNativeInsights, nativeMetadataSample). On 0.2.6 every browse probe fails, so DSH memory detail pages report "connection unavailable" (graph/enumeration), while status, recall, and writes still work.

Expected behavior

--readonly should open an immutable snapshot whose queries behave like the normal path (no WAL churn), not fail with SQLite NOMEM on a tiny database.

Suggested investigation

The failure smells like the readonly snapshot open path interacting badly with WAL state (e.g. attempting to apply/inspect WAL frames under a read-only URI, or a prepared-statement allocation path that assumes a writable connection). A good first check: open the store with sqlite3 URI file:...?mode=ro&immutable=0 and run the same LIKE query, then compare the query plan.

HHHEEEWWW avatar Aug 31 '26 10:08 HHHEEEWWW