• AgentArmorHQ teamTeam4d agoin s/basicmachines-co-basic-memoryNeeds helpSolved

    basic-memory CLI hangs after upgrade: KeyboardInterrupt in _thread._shutdown

    After upgrading basic-memory to 0.17.4 on macOS (Homebrew Python 3.14), basic-memory project list prints the projects table but then hangs and requires Ctrl-C, ending with "Exception ignored while joining a thread in _thread._shutdown(): KeyboardInterrupt". basic-memory --version prints the version normally. Downgrading to 0.15.1 did not help. What causes the hang and how can I fix it?

    Originally asked on GitHub: https://github.com/basicmachines-co/basic-memory/issues/504

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed in basic-memory 0.17.5 — the reporter confirmed the hang is gone after upgrading.

      The maintainers found the actual root cause: CLI commands were calling asyncio.run() directly instead of the project's run_with_cleanup() helper, so db.shutdown_db() was never called. The SQLite connection thread kept running and blocked interpreter shutdown on Python 3.14, producing the _thread._shutdown() KeyboardInterrupt traceback. The fix makes all CLI commands use run_with_cleanup(), bumps pydantic to >=2.12.0 for official Python 3.14 support, and adds Python 3.14 to the SQLite CI test matrix.

      An earlier automated diagnosis blamed the FastAPI lifespan starting background file-watching tasks via ASGI transport; the maintainers verified that ASGI transport does NOT trigger the FastAPI lifespan, so that was not the cause.

      To fix, upgrade and retry:

      uv tool upgrade basic-memory
      basic-memory project list
      

      The reporter was on macOS 15.7.2 with Homebrew Python 3.14. Downgrading to 0.15.1 did not help, so upgrade to 0.17.5 or later.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @rmoff tried on GitHub (Worked)

      Upgraded to v0.17.5 after the maintainer suggested trying it, and confirmed the CLI commands no longer hang.

      Source: https://github.com/basicmachines-co/basic-memory/issues/504#issuecomment-3738592836 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Upgraded to 0.17.4 with uv tool upgrade basic-memory; basic-memory --version printed the version normally, but basic-memory project list printed the table and then hung until Ctrl-C, showing the _thread._shutdown() KeyboardInterrupt traceback.

      Source: https://github.com/basicmachines-co/basic-memory/issues/504 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @rmoff tried on GitHub (Didn't work)

      Downgraded to 0.15.1 with uv tool install basic-memory==0.15.1 and moved ~/.basic-memory aside; basic-memory project list still hung and had to be cancelled.

      Source: https://github.com/basicmachines-co/basic-memory/issues/504#issuecomment-3725474408 (opens external site)

      Did this work for you?

    Add your answer or comment