Skip to content

search/query render no output + engine.disconnect() 10s force-exit on 0.42.8.0 (Postgres brain); 0.22.8 works #1775

@MshikadauMgigi

Description

@MshikadauMgigi

Summary

On gbrain 0.42.8.0 (installed via bun install -g github:garrytan/gbrain, main HEAD), gbrain search <q> and gbrain query <q> print no results and exit with:

[cli] engine.disconnect() did not return within 10000ms — force-exiting

The same brain DB queried with gbrain 0.22.8 returns correct ranked results. Only search/query are affected — list, get, sync, doctor, status all work and render output normally on 0.42.8.0.

Environment

  • gbrain 0.42.8.0 (bun install -g github:garrytan/gbrain)
  • Runtime: Bun 1.3.14 on WSL2 / Ubuntu 24.04
  • Brain: Postgres (remote), schema v112 (migrated up from v29 by 0.42.8.0)
  • Embedding model: zeroentropyai:zembed-1

Repro

$ gbrain search trak
[cli] engine.disconnect() did not return within 10000ms — force-exiting
$            # no results printed

Expected

Ranked keyword results, as gbrain 0.22.8 produces against the identical DB:

$ gbrain search trak
[0.4493] companies/shiftcare -- # ShiftCare ...
[0.3559] products/trak/trak -- ...
... (7 hits)

Evidence the data + index are healthy (the regression is in the search/query CLI path, not the data)

  • gbrain list -n 5 returns pages including products/trak/trak.
  • gbrain doctor reports all checks OK; embeddings present; no stale chunks.
  • Direct SQL against the same DB confirms FTS is fully populated:
    • SELECT count(*) FROM content_chunks WHERE search_vector @@ to_tsquery('english','trak')19
    • SELECT count(*) FROM pages WHERE search_vector @@ to_tsquery('english','trak')9
  • gbrain 0.22.8 renders the results correctly against the same DB, captured the same (non-TTY) way.

Notes / narrowing

  • Not stdout buffering. The empty output persists under a PTY (script -qec 'gbrain search trak' /dev/null), so it isn't results lost to an unflushed buffer at force-exit.
  • The engine.disconnect() did not return within 10000ms line appears only on search/query, never on list/status/doctor/sync — suggesting the search/query code path opens a connection/pool that never closes, and either (a) the process force-exits before printing results, or (b) the query returns empty due to a scoping/RLS change introduced in 0.4x.

Happy to provide more detail, logs, or test a patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions