{"record":{"id":"34a2ad295f20102e","repo":"windmill-labs/windmill","slug":"failed-to-run-new-datatable-migrations-e-body","errorCode":null,"errorMessage":"Failed to run new datatable migrations: ${e?.body ?? e?.message ?? e}","messagePattern":"Failed to run new datatable migrations: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/sync/sync.ts","lineNumber":6537,"sourceCode":"        await Promise.race(pool);\n      }\n    }\n    try {\n      await pushSharedUi(workspace.workspaceId, opts.keepDeleted);\n    } catch (e) {\n      log.warn(`Failed to push shared UI folder: ${e}`);\n    }\n    try {\n      await offerToRunNewMigrations(\n        workspace.workspaceId,\n        newDatatableMigrations,\n        {\n          yes: opts.yes,\n          jsonOutput: opts.jsonOutput,\n        },\n      );\n    } catch (e: any) {\n      log.warn(\n        `Failed to run new datatable migrations: ${e?.body ?? e?.message ?? e}`,\n      );\n    }\n    const lockJobs = await checkServerLockJobs(\n      workspace.workspaceId,\n      pushStartedAt,\n      changes.map((c) => c.path.replaceAll(SEP, \"/\")),\n    );\n    if (!opts.jsonOutput) {\n      for (const f of lockJobs.failed) {\n        log.warn(\n          `⚠ server-side lock generation FAILED for ${f.path} — the deployed script is broken until it locks.` +\n            (f.error ? `\\n  ${f.error.split(\"\\n\")[0]}` : \"\"),\n        );\n      }\n      if (lockJobs.pending > 0) {\n        log.info(\n          colors.gray(","sourceCodeStart":6519,"sourceCodeEnd":6555,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/sync/sync.ts#L6519-L6555","documentation":"After a push that introduced new datatable store usage, the CLI offers/accepts to run pending datatable migrations server-side via offerToRunNewMigrations. If that call throws (API error, user denial path error, network), the failure is logged as a warning with the error body/message rather than aborting the push, which has already completed.","triggerScenarios":"`wmill sync push` detects new datatable migrations to run, invokes offerToRunNewMigrations, and the migration-triggering API call fails (HTTP 4xx/5xx, network, invalid migration state) or the error lacks body/message.","commonSituations":"Pushing scripts bound to a datatable whose server-side migrations are pending but fail to start; insufficient permission to run migrations; server busy/unreachable at end of push.","solutions":["Run the migrations explicitly: check the workspace's datatable settings in the UI or use the dedicated migration command, then re-push.","Check the interpolated error body for the server-side reason (e.g. permission denied, migration conflict).","Retry the push once the server is healthy — migration execution is idempotent per migration."],"exampleFix":"// before\nwmill sync push  # migrations fail silently as warning\n// after\n# apply pending migrations first (UI: workspace settings → datatables), then\nwmill sync push","handlingStrategy":"try-catch","validationCode":"// Before push, check pending migrations and permissions:\nconst stores = await wmill.listDatatableStores({ workspace });\nconst pending = stores.filter((s) => s.migrationsPending);\nif (pending.length > 0) console.log('Run migrations first:', pending.map((s) => s.name));","typeGuard":"function hasMigrationError(e: unknown): e is { body?: { message?: string }; message?: string } {\n  return typeof e === 'object' && e !== null;\n}","tryCatchPattern":"try {\n  await offerToRunNewMigrations(workspaceId, migrations, opts);\n} catch (e: any) {\n  log.warn(`Migrations not run: ${e?.body ?? e?.message ?? e}`);\n  // retry via UI/datatable settings before next push\n}","preventionTips":["Apply datatable migrations proactively from workspace settings before pushing","Ensure the token can trigger migrations (deployer/admin)","Re-run migrations after server upgrades","Don't assume push success implies migration success — check for this warning"],"tags":["cli","sync","datatable","migrations"],"backgroundTag":"datatable-migration-run-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}