You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade fails at service_providers.0095 when Team has columns added by later migrations #5000
Any database with teams using a deprecated model that applies 0095 and teams.0020 in the same migrate run: self-hosted installs upgrading from before 2026-10-20 to after 2026-10-26, and older dev databases. Installs that applied the migrations as they were released, and fresh installs with no teams, are not affected.
The upgrade stops at 0095 on every retry, leaving later migrations unapplied. Faking 0095 gets past it but skips the deprecated-model notifications.
Add a team with a pipeline node whose llm_provider_model is a deprecated model (azure / gpt-4.1-nano).
Migrate back to service_providers.0094_deprecate_openai_gpt_4_models, faking 0095 since it is irreversible. This unapplies teams.0020, matching an install last updated before 2026-10-20.
migrate: 0095 fails with the error above.
Suggested fix
Load only the fields the command uses: .only("id", "name", "slug") on both Team queries (L50, L64). With that change the steps above pass: 0095 notifies the team and the remaining migrations, including teams.0020, apply. A migration dependency can't fix it, because the existing one is what forces 0095 to run first.
RunDataMigration calls commands against the live models, so any command that loads full rows can break the same way when a later migration adds a column.
None of its callers (service_providers 0071, 0077, 0085, 0089, 0095) depend on the latest pipelines or teams migrations. A fresh install passes only because migrate reaches the pipelines leaf before service_providers.
Any new migration whose dependencies pull service_providers forward breaks a fresh migrate with column pipelines_node.archived_with_pipeline does not exist. Reproduced on a fresh database with an experiments migration that depended on teams.0020; no teams needed, since earlier migrations already create deprecated LlmProviderModel rows.
.only("id", "name", "slug") on Team does not cover this query, so the fix needs the Node read narrowed too, or the command made a no-op inside migrations.
Activity
preston-56 commentedon Nov 12, 2026
Second form of the same problem, on a fresh database:
notify_deprecated_modelsalso reads liveNoderows, which selectspipelines_node.archived_with_pipeline(added inpipelines.0036):open-chat-studio/apps/data_migrations/management/commands/base.py
Line 32 in d4ca242
None of its callers (
service_providers0071, 0077, 0085, 0089, 0095) depend on the latest pipelines or teams migrations. A fresh install passes only becausemigratereaches thepipelinesleaf beforeservice_providers.Any new migration whose dependencies pull
service_providersforward breaks a freshmigratewithcolumn pipelines_node.archived_with_pipeline does not exist. Reproduced on a fresh database with anexperimentsmigration that depended onteams.0020; no teams needed, since earlier migrations already create deprecatedLlmProviderModelrows..only("id", "name", "slug")onTeamdoes not cover this query, so the fix needs theNoderead narrowed too, or the command made a no-op inside migrations.