Logic to check for deprecated stacks was added and is currently being run before migrations, see here. This runs before migrations so that if someone is using a deprecated stack, the checker fails before migrations are run so that you are not left in a state where new migrations have run but you are running old CC code.
Issue
Logic to check for deprecated stacks was added and is currently being run before migrations, see here. This runs before migrations so that if someone is using a deprecated stack, the checker fails before migrations are run so that you are not left in a state where new migrations have run but you are running old CC code.
However, this Stack Checker rake task loads all models, https://github.com/cloudfoundry/cloud_controller_ng/blob/main/lib/tasks/stack_check.rake . This causes issues when migrations have not run yet and there is a migration that is required for the model load to complete. For example adding a new table, which was done recently https://github.com/cloudfoundry/cloud_controller_ng/blob/main/db/migrations/20240514113500_create_cnb_lifecycle_data.rb . This will cause CC to fail to start as the Stack checker rake task will fail with something like in pre-start:
This issue is present in CAPI Release 1.190.0 https://github.com/cloudfoundry/capi-release/releases/tag/1.190.0 and may be hit if upgrading from an older capi release where the delta in migrations contains new tables.
Possible Fix
Do not load all models in stack checker, or better yet load no models and just use raw sql.