Skip to content

fix(web): retire provider rows as destroyed in the Blaxel and E2B/Daytona migrations - #11623

Merged
lawrencecchen merged 1 commit into
mainfrom
feat-retire-provider-rows-destroyed
Sep 2, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
feat-retire-provider-rows-destroyed

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Two unapplied Cloud VM migrations relabel rows on a retired provider without touching status. 20260901120000_remove_blaxel_vm_provider turned a running Blaxel machine into a running e2b machine; 20260902060000_remove_e2b_daytona_vm_providers (#11590) turns a running e2b or Daytona machine into a running Freestyle machine that the Freestyle driver cannot find. Both files now mark every non-destroyed row on a retired provider destroyed first (status, destroyed_at, updated_at, failure_code provider_retired, a provider-specific failure_message), the way markDestroyed does at runtime, and only then relabel for the enum rebuild. Reads already hide destroyed rows, and a base whose active machine is destroyed opens a fresh generation on the default provider.

The Blaxel file is commit f75673f re-applied verbatim; it was reverted from #11587 so the read-path fix could ship during the incident. Its dry run against production inside a rolled-back transaction retired 8 rows and relabeled 17. The E2B/Daytona file mirrors its structure.

Provider comparisons are cast to ::text in both files. On a fresh database every migration runs in one transaction and Postgres rejects an enum literal for a label added by an earlier ALTER TYPE ... ADD VALUE ("unsafe use of new value"). daytona is such a label; today it resolves only because the Blaxel rebuild re-creates the type immediately before. 20260902090000_cloud_vm_private_networks sorts after both and creates its tables against the rebuilt type, so ordering is unaffected.

This PR assumes both migrations are still unapplied in staging and production, as f75673f's message states. No read-only staging status command is documented in the cloud-vm-ops skill, so I could not confirm it. drizzle's migrator skips any migration whose folder name is already present in drizzle.__drizzle_migrations, so editing an applied migration is silently ignored. The operator must check that table before applying.

Operator steps, in order: select name from drizzle.__drizzle_migrations where name like '2026090%' on staging and production and confirm neither 20260901120000_remove_blaxel_vm_provider nor 20260902060000_remove_e2b_daytona_vm_providers is listed; delete the live Blaxel, E2B, and Daytona sandboxes in their provider consoles (the migration only records that they are gone); bun run cloud-vm:migrate -- staging, verify, then bun run cloud-vm:migrate -- production.

Verification: bun run db:check passes. bun run cloud-vm:preflight -- . applied the full migration set twice to a fresh Docker Postgres (both migrations included) and db-schema.test.ts passed. The behavior-test phase then had 83 failures across 7 files, every one a 5000ms per-test timeout under a local load average of 30 (other agents' builds); none touches these migrations. A rerun of those 7 files against a fresh test database with a 120s per-test timeout passed every test (12, 26, 35, 24, 1, 1, 80). After that fresh run drizzle.__drizzle_migrations listed both migrations and enum_range(null::vm_provider) was {freestyle}. bun run typecheck exits 0. bun test tests/vm-retired-provider-rows.test.ts passes.

Local $autoreview (gpt-5.6-sol, high) returned one P1 claiming the Blaxel file does not rewrite cloud_vm_bases.active_provider or cloud_vm_base_generations.provider. It does (lines 42-43); those lines are unchanged against main, so they are outside the diff hunk the reviewer read, and the DROP TYPE interlock passing on the fresh database proves no column still referenced the old type. No code change was made for it.

Supersedes #11582, which only added the text cast to the Blaxel file (main already carries that cast).

https://claude.ai/code/session_01AvkeWizggvvUAngHyB7JUQ

…tona migrations

Both enum-removal migrations relabeled rows on a retired provider without
touching status, so a running Blaxel machine came back as a running e2b
machine and a running e2b or Daytona machine comes back as a running
Freestyle machine that the Freestyle driver cannot find. Both migrations
now mark every non-destroyed row on a retired provider destroyed first,
the way markDestroyed does it at runtime, with failure_code
'provider_retired' and a provider-specific failure_message, then relabel
for the enum rebuild. Reads hide destroyed rows and a base whose active
machine is destroyed opens a fresh generation on the default provider.

The Blaxel file is the content of f75673f,
which was reverted from PR 11587 so the read-path fix could ship during the
incident. Its dry run against production inside a rolled-back transaction
retired 8 rows and relabeled 17.

Provider comparisons are cast to text in both files. On a fresh database
every migration runs in one transaction and Postgres rejects an enum
literal for a label added by an earlier ALTER TYPE ... ADD VALUE
("unsafe use of new value"). 'daytona' is such a label; today it only
resolves because the Blaxel rebuild re-creates the type first.

This assumes both migrations are still unapplied in staging and production.
drizzle skips any migration whose folder name is already in
drizzle.__drizzle_migrations, so an edit to an applied migration would be
silently ignored. Verify that table before applying.

Verified: drizzle-kit check passes; cloud-vm:preflight applied the full
migration set twice to a fresh Docker Postgres and db-schema.test.ts
passed; tsgo --noEmit passes; vm-retired-provider-rows.test.ts passes.

Claude-Session: https://claude.ai/code/session_01AvkeWizggvvUAngHyB7JUQ
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cmux166 Ready Ready Preview Sep 3, 2026 8:29am UTC
cmux41 Ready Ready Preview Sep 3, 2026 8:29am UTC

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 35045f08-a3e3-461a-bdcc-d50c9a5d9f93

📥 Commits

Reviewing files that changed from the base of the PR and between 759d3e0 and 49d2fc9.

📒 Files selected for processing (2)
  • web/db/migrations/20260901120000_remove_blaxel_vm_provider/migration.sql
  • web/db/migrations/20260902060000_remove_e2b_daytona_vm_providers/migration.sql

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@lawrencecchen
lawrencecchen merged commit 392f83d into main Sep 2, 2026
9 of 11 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 2, 2026
c8ec44d Cloud VPC follow-ups: copyable machine IPs, working tree menu, no HTTP modal on private addresses (manaflow-ai#11626)
cbda3b0 ci: land base-controlled CLA policy guard (manaflow-ai#11606)
40d1dc6 CLI: return notification ids and support scoped clear (manaflow-ai#10336)
d86d5f3 fix(relay): offload bounded filesystem actions (manaflow-ai#11568)
9778ac7 Plus menu: one New Cloud VM item that opens the New Machine sheet (manaflow-ai#11603)
392f83d fix(web): retire provider rows as destroyed in the Blaxel and E2B/Daytona migrations (manaflow-ai#11623)
c1ce87c Cloud: create machines in the background; Create returns control immediately (manaflow-ai#11397) (manaflow-ai#11421)

This branch was successfully deployed

2 active deployments
Preview – cmux166 — 49d2fc95 Deployed Sep 3, 2026 by vercel[bot]
Preview – cmux41 — 49d2fc95 Deployed Sep 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant