Skip to content

[bug] Pro build with the multi-database switcher crash-loops at launch (stable single-DB build unaffected) #1644

Closed

Description

@mstomar125

Observed

On-device: the newer Pro desktop build that includes the ADR-053 multi-database support (database switcher in the sidebar, per-database settings) crash-loops at launch. The previous stable build works, but it is deliberately single-database — so there is no switcher there and the multi-DB flow cannot be exercised at all right now.

Impact

  • Multi-DB UI (switcher, register/remove database, per-DB settings) is unusable on real devices.
  • Blocks on-device validation of the ADR-053 follow-on work (per-database sync binding, registry-driven Pro UI surfaces).

Diagnostics needed (from the affected machine)

  • Crash reports: ~/Library/Logs/DiagnosticReports/NodeSpace* (or Console.app → Crash Reports) from a crash-loop window.
  • Daemon log output if the app gets far enough to spawn it.
  • Which artifact exactly (build date / commit / .pkg name) crash-loops, and whether a fresh ~/.nodespace reproduces it (to separate DB-migration crashes from cold-boot crashes).

Suspects to check first

  • DatabaseManager/registry boot path reading an existing single-DB layout (migration of ~/.nodespace/database into the registry).
  • Tray init (the newer daemon builds the tray at boot).
  • Sidecar/binary mismatch in the bundle (per-arch sidecars, daemon proto drift vs frontend).

Acceptance

  • The multi-DB build launches cleanly on device (existing profile and fresh profile), switcher renders and switching works.
  • Root cause documented; if it was a migration crash, a regression test covers upgrading a pre-multi-DB profile.

Activity

  1. mstomar125 commented on Jul 16, 2026

    @mstomar125
    ContributorAuthor

    Triage update from live-validation round-1 (2026-07-16, build core 330799b2 / sync 50ef06d):

    A 100% clean-room install (fresh app, wiped ~/.nodespace, wiped webview localStorage, cleared keychain) did NOT reproduce a daemon crash-loop — single stable pid, clean log, no Failed to create schema node database-settings loop, across multiple relaunches including against existing non-empty DBs.

    The permanent-"Loading" symptom that opened this issue decomposes into two now-separately-tracked frontend bugs:

    Plus one related daemon defect in the same area: #1675 (database create never creates the DB file and wedges routing — the multi-DB switcher path).

    Suggest closing this as superseded once #1672/#1673 land; leaving open until then in case the original crash-loop signature reappears on a device we haven't tested.

  2. mstomar125 commented on Jul 17, 2026

    @mstomar125
    ContributorAuthor

    Status after round-1 fixes (local physical-device session, 2026-07-17)

    The round-1 clean-room run found no daemon crash-loop — a single stable pid, clean daemon log. The "crash-loop / permanent-Loading" symptom that opened this issue was actually two frontend problems, both now addressed:

    The remaining Pro-multi-DB-specific gap is sync#327: the Pro daemon (nodespaced-pro) installs no DbManagerLayer and reports its default DB as closed. After core#1675/#1676 + the core-pin bump (sync#330), the Pro daemon behaves honestly — it creates DB files and returns UNIMPLEMENTED for a named-DB request instead of serving a wrong-DB read. It does not crash.

    Round-2 Bucket C plan (real device):

    1. Launch the Pro multi-DB build (fresh profile + existing profile). Capture ~/Library/Logs/DiagnosticReports/NodeSpace* and the daemon log.
    2. Confirm no crash-loop (single stable pid).
    3. On the Pro daemon, does a default-DB request serve or return UNIMPLEMENTED? A UNIMPLEMENTED on the default confirms the sync#327 routing gap; a named 2nd-DB switch is expected to error cleanly (design-gated, see sync#327) rather than crash.

    Keeping OPEN pending the device-log capture in round 2.

  3. mstomar125 commented on Aug 1, 2026

    @mstomar125
    ContributorAuthor

    On-device investigation (2026-08-01)

    Reproduced the boot against a pre-multi-DB single-DB profile (existing ~/.nodespace/daemon-pro-db + empty database/, no databases.toml) — the exact registry-migration scenario suspected. Built the current nodespaced-pro and booted it directly against a sandboxed copy of that profile.

    Result: the Pro daemon boots this profile cleanly. It seeds core schemas, opens daemon-pro-db as the default via DatabaseManager::ensure_default_registered, resolves the bound tenant, and serves gRPC on the UDS — no panic, no error:

    INFO nodespaced_pro: serving default database served_db_path=…/daemon-pro-db
    INFO nodespaced_pro: effective cloud tenant schema=tenant_public collection=…
    INFO nodespaced_pro: gRPC: serving base community services + CloudSyncService on UDS
    

    So the registry/DB-migration boot path is NOT the crash source — it's exonerated at the daemon level. (One red herring worth noting: an over-long socket path trips bind unix socket … path must be shorter than SUN_LEN, but the app's real socket is the short ~/.nodespace/daemon-pro.sock, so that's not it either.)

    That narrows the crash-loop to the desktop app layer: Tauri setup / tray init / the multi-DB registry-driven UI surfaces / a per-arch sidecar mismatch in the bundle. Next step is to reproduce with the actual Pro app running (dev-mode or a fresh bundle) and capture the app-side panic — the daemon can be ruled out.

  4. mstomar125 commented on Aug 1, 2026

    @mstomar125
    ContributorAuthor

    Verified fixed on current main (on-device, 2026-08-01)

    Built the current-main Pro app (build-pro-dmg.sh, aarch64, v0.2.0 — includes the ADR-053 multi-DB support + all rework since this issue was filed) and launched it on this Mac against the exact prime-suspect profile: an existing pre-multi-DB single-DB layout (~/.nodespace/daemon-pro-db + empty database/, no databases.toml — the registry-migration scenario).

    Result: it launches cleanly — no crash-loop.

    • App process healthy and stable (same PID across repeated checks, launchctl list exit 0), daemon (nodespaced-pro) healthy and serving.
    • Zero crash reports in ~/Library/Logs/DiagnosticReports/NodeSpace* throughout.

    Independently, the daemon was exonerated first (see prior comment): booting nodespaced-pro directly against a sandboxed copy of the same profile — local-only and with the real plist Pro Supabase env — seeds schemas, opens daemon-pro-db as the default via DatabaseManager::ensure_default_registered, resolves the tenant, and serves gRPC, with no panic. So neither the registry-migration boot nor the app launch reproduces the crash-loop.

    Likely fix: the multi-DB switcher UI that this issue reported crash-looping was reworked after the report — #1722 (switcher → Settings, per-row bound tenant, reload-persist) and #1711 (re-target Pro cloud-sync on DB switch) replaced the original sidebar-switcher code path.

    Closing as resolved. If a crash-loop recurs on a specific fresh-profile or device configuration, please reopen with the DiagnosticReports crash file — the original report lacked one, and it doesn't reproduce here.

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

Metadata

Metadata

Assignees

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