When you attempt to upgrade IDSP to version 4.0.2 or higher, the ssp-ssp-dataseed-job fails. The logs for the ssp-db-init container show a FlywayMigrateException similar to the following:
Message : (conn=########) Table 'T_MACHINES' already exists Location : db/migration/mysql/V1.217__AddMachines.sql
This issue occurs if you previously attempt to downgrade the environment by running a helm upgrade command using an older version's details (e.g., version 3.4.2) instead of using helm rollback.
When you "upgrade" to a lower version, Flyway marks migrations that do not exist in the older version as DELETED in the flyway_schema_history table. However, Flyway does not physically drop the tables or undo the schema changes. Consequently, when you attempt a legitimate upgrade to a newer version, Flyway tries to re-run the "deleted" scripts and fails because the database objects already exist.
To prevent this issue, do not attempt to downgrade by "upgrading" to an older version. Starting with version 3.4.8, protections are in place to help prevent this state.
If you are already in this state, perform the following steps to workaround the upgrade failure:
kubectl delete pod [pod-name] -n [namespace]