Skip to content

gemdb refuses to start a database without Python support #115

Open

Description

@MatiasFernandez

Related: #105 covers the editor's Shell and Run File repairing a running database. This issue is the CLI half.

Problem. The gemdb wrapper (cli.ts) and the Shell's ensureDatabase (cliMain.ts) start the stone with no Grail check. That is how a "running but no Python" database arises; PR #103 repairs it, but only at the next activation. What users see from the wrapper (measured):

  • Account present, no Grail: gemdb -c … and gemdb file.py dump the whole ~150-line run block of gemdb-run.tpz as "GemStone Smalltalk Compiler Errors", ending in [1031] undefined symbol, and exit 1.
  • CLI-first, before any editor bring-up: the gemdb account doesn't exist yet, so the login fails with GemStone error 4051.
  • The Shell is already fine: it says "Python support is not installed in this database…". The wrapper is the part to fix.

Who hits it. Brain Freeze's tutorial has readers set up GemDB, then makes gemdb tools/seed.py the first command. A reader who runs it right after "GemDB is ready", before auto-start has filed Grail in, or after pressing Stop, gets the dump. Brain Freeze's own CI works around exactly this race (ci/setup-gemdb/run.js waits for the editor and probes with gslist, not gemdb).

Decided (2026-10-06): refuse, don't install.

  • When Grail was never filed in, the wrapper and the Shell refuse to start the stone. They print e.g. "Python support is not installed in the database yet: open VS Code and press Start", and exit non-zero.
  • A stone that's already running without Grail gets the same message instead of the compile-error dump.
  • The check is "never filed in": grailInstalled(), which tests the stamp <root>/grail/.gemdb-grail-stamp. It is not grailFileInDue/grailNeedsUpdate, because an older Grail still runs Python.
  • The bash wrapper can't call TS, so it tests the stamp file directly. Keep that path in one place: Grail and MCP versioning: gaps the new install mechanism must not inherit #110 replaces the stamp, and the swap should be one line on each side.
  • External databases skip the check (the wrapper already has an external branch). The local stamp says nothing about an administrator's database.
  • Rejected: the wrapper filing Grail in itself. That would mean a bash copy of the installer, with no progress UI, racing an editor.

Done when: the wrapper's -c, file and -m modes, and the Shell, each print the message and exit non-zero on a database with no stamp. This needs a test with a pty, or the wrapper's own bash tests.

Activity

  1. ericwinger commented on Oct 12, 2026

    @ericwinger
    Member

    Related: #119 is the same root cause in the Persisted Objects view, which can show a stale error if it reads gemdb.root before Python support is installed. Its fix could use the same "never filed in" check this issue settles on. #105 covers the editor's Shell and Run File.

  2. MatiasFernandez commented on Oct 14, 2026

    @MatiasFernandez
    CollaboratorAuthor

    Related to the external-database check, which this issue edits in cliMain.ensureDatabase (src/cliMain.ts ~:51).

    The same "is the external database up" check is duplicated in startProcesses (src/lifecycle.ts ~:751): const running = listProcesses(); if (!findStone(running) || !findNetldi(running)) throw externalDatabaseDownError(external);. Both exist because ensureProcesses refuses external databases.

    Suggest centralising it while here: one ensureDatabaseUp() in processes.ts, called from both.

    It should use "ready" semantics (stoneReady/listenerReady, status OK), not "listed". The current check is "listed", which is inconsistent with the listed/ready split from #118.

    This lands sensibly only after #118 merges, since the readiness predicates come from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions