Skip to content

[Bug]: Updates from official 0.0.46-preview.2909 fail: migration 61 renumbered (PeerLinks → PullRequestReviewGuides), no upgrade path #21284

Closed

Description

@lebasoft

Before submitting

Area

Server: persistence / migrations / self-update

Steps to reproduce

  1. Run the official build 0.0.46-preview.20261010.2909 (tag v0.0.46-preview.20261010.2909, commit 01cd49f65d2c) on Linux as the managed server. It applies 061_PeerLinks, so effect_sql_migrations records (61, 'PeerLinks').
  2. Update to any newer 0.1.1 build. Tried: 0.1.1-nightly.20261016.3190, 0.1.1-nightly.20261016.3203, 0.1.1-preview.20261017.3254 and 0.1.1-preview.20261018.3300. 3327 contains no migration changes relative to 3300.

Expected behavior

There is an upgrade path from an official build's migration history. Newer builds renumbered the migrations: on main, 61 is PullRequestReviewGuides, and the 3300 binary has 64_PeerLinks. The migrator should recognise that 61/PeerLinks was already applied and run the missing migrations 61–63.

Actual behavior

The candidate exits with code 1 on startup, and the service launcher rolls back to 2909 (status: rolled-back, reason: candidate-exited:1). This has happened on every update since 2026-10-16:

MigrationError: This database's migration history would skip required schema migrations: 61_PullRequestReviewGuides (recorded: PeerLinks). The migrator skips every id up to the highest recorded id (61), 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.
    at assertV2MigrationsCanRun
    at runMigrations

Tail of effect_sql_migrations:

61 | 2026-10-10 19:55:21 | PeerLinks
60 | 2026-10-10 00:10:26 | ThreadSnapshotWindowIndexes
59 | 2026-10-10 00:10:26 | McpAppModelContext
58 | 2026-10-08 19:10:50 | WebhookRelayDeliveries
57 | 2026-10-08 19:10:50 | ScheduledTaskWebhooks

apps/server/src/persistence/Migrations at 01cd49f (2909) has 061_PeerLinks.ts. On current main it has 061_PullRequestReviewGuides.ts, 062_ThreadFailureLookupIndex.ts and 063_DropUnusedV1Projections.ts.

Impact

The server can't move past 2909: every new build fails and rolls back. Each attempt also causes about a minute of downtime, during which running threads are interrupted. statev2.sqlite is about 4 GB with active history, so recreating it isn't an option, and we would rather not hand-edit migration rows. 063_DropUnusedV1Projections is destructive, and PeerLinks would be re-applied.

Version or commit

Active: 0.0.46-preview.20261010.2909 (01cd49f). Failing: 3190, 3203, 3254 and 3300; 3327 contains no migration changes relative to 3300.

Environment

Linux x64 (Ubuntu, kernel 6.8). Headless managed server via t3 __service-launcher under a systemd user service, T3 Connect relay.

Logs or stack traces

See above. The service launcher state records targetVersion: 0.1.1-preview.20261018.3300, status: rolled-back, reason: candidate-exited:1.

A supported recovery path would help, either a name-aware remap in the migrator or documented manual steps.

Activity

  1. lebasoft commented on Oct 19, 2026

    @lebasoft
    Author

    Resolved on our side with 0.1.1-preview.20261019.3339. That build moved PeerLinks to 064_PeerLinks.ts, which is byte-identical to the 2909 061_PeerLinks.ts and uses CREATE TABLE IF NOT EXISTS, so this manual path was safe:

    1. Took a consistent backup of statev2.sqlite (VACUUM INTO).
    2. Deleted the single row (61, 'PeerLinks') from effect_sql_migrations.
    3. Updated to 3339. Migrations 61–66 applied: 064 was a no-op on the existing table and 065 added fenced. The update was committed with no MigrationError.

    Leaving this here for anyone else upgrading from 0.0.46-preview.2909. A name-aware reconcile like reconcileV2PreviewMigration for 61/PeerLinks would make this automatic. Closing.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions