Database schema fails

During the installation of version 4.2.1.10 I run into the following error in the database step, where some columns cant be initialized. The mariadb step during the installation is also not working so I tried it here with a fresh installation of mine. I tried for the baseline version 0.0.0.0, blanked (which defaults to 2.3.0.0). Same error every time

I am working on centos9-stream

Also I am courios if its possible to continue the installation script from a specific step as it doesnt work when I start it again.

Please validate information below
---------------------------------
FLYWAY_BASELINE_VERSION=2.3.0.0
FLYWAY_OPENIAM_DATABASE_NAME=openiam
FLYWAY_ACTIVITI_DATABASE_NAME=activiti
FLYWAY_OPENIAM_HOST=localhost
FLYWAY_OPENIAM_PORT=3306
FLYWAY_ACTIVITI_HOST=localhost
FLYWAY_ACTIVITI_PORT=3306
FLYWAY_DATABASE_TYPE=mysql
Database will be initialized=Y
Root (Db admin) user name=root
Root (Db admin) user password=root
---------------------------------
Please validate your input above, if your are OK with that enter 'y'. To repeat an information collecting procedure enter 'n' :y
Mysql. Try to initialize automatically
/usr/local/openiam/conf/schema/mysql/openiam/
A new version of Flyway is available
Upgrade Flyway: Command-line - Redgate Flyway - Product Documentation
Flyway Community Edition 9.5.1 by Redgate
See what's new here: Release Notes for Flyway Engine - Redgate Flyway - Product Documentation

Database: jdbc:mysql://localhost:3306/openiam (MariaDB 10.5)
Creating Schema History table `openiam`.`flyway_schema_history` with baseline ...
Successfully baselined schema with version: 2.3.0.0
Successfully validated 1201 migrations (execution time 00:00.731s)
Current version of schema `openiam`: 2.3.0.0
Migrating schema `openiam` to version "2.3.0.0.001 - mysql schema common"
Migrating schema `openiam` to version "2.3.0.0.002 - mysql schema security"
Migrating schema `openiam` to version "2.3.0.0.003 - mysql idm data"
Migrating schema `openiam` to version "3.0.0.0.001 - alter table attribute map"
Migrating schema `openiam` to version "3.0.0.0.002 - create resource many to many mapping"
Migrating schema `openiam` to version "3.0.0.0.003 - create group many to many mapping"
Migrating schema `openiam` to version "3.0.0.0.004 - migrate role id"
Migrating schema `openiam` to version "3.0.0.0.005 - migrate resource role mappings"
Migrating schema `openiam` to version "3.0.0.0.006 - create role many to many mapping"
Migrating schema `openiam` to version "3.0.0.0.007 - create group and role name constraints"
Migrating schema `openiam` to version "3.0.0.0.008 - add authorization data to resources"
Migrating schema `openiam` to version "3.0.0.0.009 - migrate menus to resources"
Migrating schema `openiam` to version "3.0.0.0.010 - fix resource name and type"
Migrating schema `openiam` to version "3.0.0.0.011 - add url protector column to res"
Migrating schema `openiam` to version "3.0.0.0.012 - fix group name"
Migrating schema `openiam` to version "3.0.0.0.013 - add fk to users"
Migrating schema `openiam` to version "3.0.0.0.014 - remove obsolete res and role fields"
Migrating schema `openiam` to version "3.0.0.0.015 - fix role name"
Migrating schema `openiam` to version "3.0.0.0.016 - update menu urls"
Migrating schema `openiam` to version "3.0.0.0.017 - role menus"
Migrating schema `openiam` to version "3.0.0.0.018 - fix group name"
Migrating schema `openiam` to version "3.0.0.0.019 - drop deprecated group columns"
Migrating schema `openiam` to version "3.0.0.0.020 - group menus"
Migrating schema `openiam` to version "3.0.0.0.021 - create group categories"
Migrating schema `openiam` to version "3.0.0.0.022 - fix id lenght metadata category"
ERROR: Migration of schema `openiam` to version "3.0.0.0.022 - fix id lenght metadata category" failed! Please restore backups and roll back database and code!
ERROR: Migration V3.0.0.0.022__fix_id_lenght_metadata_category.sql failed
------------------------------------------------------------------
SQL State : HY000
Error Code : 1833
Message : (conn=6) Cannot change column 'TYPE_ID': used in a foreign key constraint 'openiam/FK_CATEGORY_METADATA_TYPE' of table 'openiam/CATEGORY_TYPE'
Location : /usr/local/openiam/conf/schema/mysql/openiam/3.0.0.0/V3.0.0.0.022__fix_id_lenght_metadata_category.sql (/usr/local/openiam/conf/schema/mysql/openiam/3.0.0.0/V3.0.0.0.022__fix_id_lenght_metadata_category.sql)
Line : 2
Statement : ALTER TABLE METADATA_TYPE MODIFY TYPE_ID varchar(32) not null

Caused by: Migration V3.0.0.0.022__fix_id_lenght_metadata_category.sql failed
------------------------------------------------------------------
SQL State : HY000
Error Code : 1833
Message : (conn=6) Cannot change column 'TYPE_ID': used in a foreign key constraint 'openiam/FK_CATEGORY_METADATA_TYPE' of table 'openiam/CATEGORY_TYPE'
Location : /usr/local/openiam/conf/schema/mysql/openiam/3.0.0.0/V3.0.0.0.022__fix_id_lenght_metadata_category.sql (/usr/local/openiam/conf/schema/mysql/openiam/3.0.0.0/V3.0.0.0.022__fix_id_lenght_metadata_category.sql)
Line : 2
Statement : ALTER TABLE METADATA_TYPE MODIFY TYPE_ID varchar(32) not null

Caused by: java.sql.SQLTransientConnectionException: (conn=6) Cannot change column 'TYPE_ID': used in a foreign key constraint 'openiam/FK_CATEGORY_METADATA_TYPE' of table 'openiam/CATEGORY_TYPE'
Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Cannot change column 'TYPE_ID': used in a foreign key constraint 'openiam/FK_CATEGORY_METADATA_TYPE' of table 'openiam/CATEGORY_TYPE'
Caused by: java.sql.SQLException: Cannot change column 'TYPE_ID': used in a foreign key constraint 'openiam/FK_CATEGORY_METADATA_TYPE' of table 'openiam/CATEGORY_TYPE'

Hello @iam,

Sorry for the trouble you’ve experienced during installation. I believe you wrote that you are using v4.2.1.10 – could you please install the current release of the Community Edition which is 4.2.1.14? We have documentation for doing so at this link: https://docs.openiam.com/docs-4.2.1.14/installation/1-rpm-installation/1-singlenode

Please let me know if you run into any issues.

Thanks,

Ameet

Hello, I tried the 4.2.1.14 version but I run into the same error. Everything works fine until setting up the database.

Kind regards

Could you please share the RPM installation log during the step where the Maria DB installation fails?

Thanks.

The installation log file can be found at /usr/local/openiam/init.log