Skip to content

[Bug]: Desktop stuck on "Connecting to WSL" after update due to renumbered migrations 63-65 (MigrationError) #21936

Closed as not planned

Description

@ham-zax

Before submitting

Area

apps/desktop

Steps to reproduce

  1. Install and run T3-Code-0.1.1-preview.20261017.3254-x64.exe with WSL integration enabled.
    This applies migrations up to 65 in ~/.t3/userdata/statev2.sqlite (63: PeerLinks, 64: PeerLinkFence, 65: WaitingLinkRequestIndex).
  2. Update/upgrade to T3-Code-0.1.1-nightly.20261019.3373-x64.exe (WSL runtime sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866).
  3. Launch T3 Code and connect to WSL.

Expected behavior

The WSL backend process starts up, runs any pending migrations or reconciles renumbered migrations, marks the runtime ready, and connects to the desktop app.

Actual behavior

The desktop UI gets stuck on the "Connecting to WSL" loading screen indefinitely.

Under the hood, the WSL backend child process crashes immediately on launch with exit code 1 because the migrations between the preview build and the nightly build were renumbered/replaced:

  • In 0.1.1-preview.20261017.3254: ID 63 was PeerLinks, ID 64 was PeerLinkFence, ID 65 was WaitingLinkRequestIndex.
  • In 0.1.1-nightly.20261019.3373: ID 63 is DropUnusedV1Projections, ID 64 is CanonicalizeThreadPullRequestLinks.

Because ID 65 was already recorded, assertV2MigrationsCanRun aborts with MigrationError. The desktop app continuously retries spawning the backend, resulting in an infinite loading loop.

Impact

Blocks work completely

Version or commit

  • Upgraded from: T3-Code-0.1.1-preview.20261017.3254
  • Upgraded to: T3-Code-0.1.1-nightly.20261019.3373
  • WSL Runtime: sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866

Environment

Windows 11, WSL2 (Ubuntu), T3 Code Desktop 0.1.1-nightly.20261019.3373

Logs or stack traces

From %USERPROFILE%\.t3\userdata\logs\server-child.log:

{"message":"backend child process failure output start","level":"ERROR","timestamp":"2026-10-19T21:10:10.471Z","annotations":{"component":"desktop-backend-child","runId":"f6a6d11d3856","instanceId":"primary","phase":"START","details":"pid=8020 port=3774 cwd=C:\\Users\\Hamza"},"spans":{},"fiberId":"#backend-child"}
{"message":"backend child process output","level":"INFO","timestamp":"2026-10-19T21:10:10.472Z","annotations":{"component":"desktop-backend-child","runId":"f6a6d11d3856","instanceId":"primary","stream":"stdout","text":"[02:40:10.433] ERROR (#1): MigrationError: This database's migration history would skip required schema migrations: 63_DropUnusedV1Projections (recorded: PeerLinks), 64_CanonicalizeThreadPullRequestLinks (recorded: PeerLinkFence). The migrator skips every id up to the highest recorded id (65), regardless of name. It was probably written by a different build. Start the build that wrote it, or report this migration history so an upgrade path can be added.\n    at file:///home/hamza/.t3/wsl-runtime/sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866/t3:116153:17\n    at assertV2MigrationsCanRun (file:///home/hamza/.t3/wsl-runtime/sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866/t3:116162:26)\n    at assertV2MigrationsCanRun (definition) (file:///home/hamza/.t3/wsl-runtime/sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866/t3:116138:29)\n    at runMigrations (file:///home/hamza/.t3/wsl-runtime/sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866/t3:116243:10)\n    at runMigrations (definition) (file:///home/hamza/.t3/wsl-runtime/sha256-3ab3de9154fd1724be4800fa01d3df0906ffa35fa3e7a7ed1c4d7110b9c7a866/t3:116159:18)"},"spans":{},"fiberId":"#backend-child"}
{"message":"backend child process failure output end","level":"ERROR","timestamp":"2026-10-19T21:10:10.473Z","annotations":{"component":"desktop-backend-child","runId":"f6a6d11d3856","instanceId":"primary","phase":"END","details":"pid=8020 code=1"},"spans":{},"fiberId":"#backend-child"}

Recorded migration history before manual intervention in ~/.t3/userdata/statev2.sqlite:

SELECT migration_id, name FROM effect_sql_migrations ORDER BY migration_id DESC LIMIT 5;
-- 65 | WaitingLinkRequestIndex
-- 64 | PeerLinkFence
-- 63 | PeerLinks
-- 62 | ThreadFailureLookupIndex
-- 61 | PullRequestReviewGuides

Workaround

Close T3 Code and delete conflicting migration rows >= 63 from effect_sql_migrations in both ~/.t3/userdata/statev2.sqlite (WSL side) and %USERPROFILE%\.t3\userdata\statev2.sqlite (Windows side):

sqlite3 ~/.t3/userdata/statev2.sqlite "DELETE FROM effect_sql_migrations WHERE migration_id >= 63;"
sqlite3 /mnt/c/Users/<user>/.t3/userdata/statev2.sqlite "DELETE FROM effect_sql_migrations WHERE migration_id >= 63;"

Once the recorded migration ceiling is reset to 62 (ThreadFailureLookupIndex), restarting T3 Code successfully applies 063_DropUnusedV1Projections and 064_CanonicalizeThreadPullRequestLinks, and the WSL backend connects normally.

Activity

  1. juliusmarminge commented on Oct 19, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Thanks for the log, it shows exactly what happened.

    That preview build carries peer link migrations at 63 to 65 that aren't on main. Main uses 63 and 64 for other migrations and has no peer link migrations at all (apps/server/src/persistence/Migrations.ts:73-77). Because the migrator skips every id up to the highest one already recorded, the server refuses to start rather than silently skip two required migrations (Migrations.ts:158-189). That refusal is intended, since it protects your data. The only automatic repair today covers an older preview numbering (apps/server/src/persistence/reconcileV2PreviewMigration.ts:10-56).

    Moving a database from a preview build back to nightly isn't a supported path while the preview has migrations main doesn't. For now, going back to the preview build that wrote the database starts it again, as the error message suggests.

    Closing this as not planned.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions