Error attempting to run restore for job bbr-uaadb on backup_restore/253426a1-a4a7-4882-b65f-700840974d8b: 2023/03/22 15:54:30 MYSQL server version 8.0.30-22 ERROR 3780 (HY000) at line 25: Referencing column 'SESSION_PRIMARY_ID' and referenced column 'PRIMARY_ID' in foreign key constraint 'SPRING_SESSION_ATTRIBUTES_FK' are incompatible. 2023/03/22 15:54:30 You may need to delete the artifact-file that was created before re-running. exit status 1 - exit code 1
To workaround the issue we will connect to the MySQL database and initialize the DB.
1. SSH to the Mysql Database in TAS deployment
2. Connect to the Mysql process running
sudo mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf
3. Confirm the character and collation set of UAA database is set to utf8mb4 and utf8mb4_0900_ai_ci.
mysql> use uaa;
mysql> SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
mysql> SELECT @@character_set_database, @@collation_database;
+--------------------------+----------------------+ | @@character_set_database | @@collation_database | +--------------------------+----------------------+ | utf8mb4 | utf8mb4_0900_ai_ci | +--------------------------+----------------------+
mysql> SELECT SCHEMA_NAME,DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='uaa';
+-------------+----------------------------+------------------------+ | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | +-------------+----------------------------+------------------------+ | uaa | utf8mb4 | utf8mb4_0900_ai_ci | +-------------+----------------------------+------------------------+
4. If your TAS 3.0 deployment is set to use utf8mb4 and utf8mb4_0900_ai_ci then continue, if the values do not match you are likely not suffering from this specific issue. Please open a support case to investigate.
5. Drop the UAA Database and Create w/ character and collation defaults
mysql> DROP DATABASE uaa;
mysql> CREATE DATABASE uaa CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci;
mysql> exit
At this point you can resume running your BBR Restore foundation. Although we are dropping the UAA database this should be tolerated since there should be no critical workloads running on the platform yet.