percussion / percussioncms

Percussion CMS - Content Management System
https://percussioncmshelp.intsof.com/percussioncms
Apache License 2.0
11 stars 9 forks source link

Issue starting metadata service after update with DTS configured to run against Linux MySQL #1220

Closed natechadwick closed 4 months ago

natechadwick commented 6 months ago

Describe the bug

When upgrading then from a previous version 8.x or 5.x to the latest 8.1.3 when the DTS is configured with a MySQL database running on MySQL on the linux platform, the metadata service fails to start with Liquibase migration errors.

To Reproduce

Steps to reproduce the behavior:

  1. Upgrade a DTS configured to run against a MySQL server database that runs on the case-sensitive Linux platform.
  2. Start the DTS
  3. Note that the following errors occur, and the updated metadata application fails to start correctly.

on MySQL:

2024-02-27 08:48:43,531 [main] INFO  org.apache.catalina.startup.HostConfig- Deploying web application archive [/home/percussion/Percussion/Deployment/Server/webapps/perc-metadata-services.war]
2024-02-27 08:48:57,897 [main] INFO  liquibase.servicelocator- Cannot load service: liquibase.change.Change: Provider liquibase.change.core.LoadDataChange could not be instantiated
2024-02-27 08:48:57,899 [main] INFO  liquibase.servicelocator- Cannot load service: liquibase.change.Change: Provider liquibase.change.core.LoadUpdateDataChange could not be instantiated
2024-02-27 08:48:59,338 [main] INFO  liquibase.changelog- Reading from percussion.DATABASECHANGELOG
2024-02-27 08:48:59,555 [main] INFO  liquibase.lockservice- Successfully acquired change log lock
2024-02-27 08:48:59,572 [main] INFO  liquibase.command- Using deploymentId: 9041739572
2024-02-27 08:48:59,579 [main] INFO  liquibase.changelog- Reading from percussion.DATABASECHANGELOG
Running Changeset: changeLogIndex1.xml::20170503041525-1::user
2024-02-27 08:48:59,618 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex1.xml::20170503041525-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLogIndex2.xml::20170503041526-1::user
2024-02-27 08:48:59,630 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex2.xml::20170503041526-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLogIndex3.xml::20170503041527-1::user
2024-02-27 08:48:59,634 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex3.xml::20170503041527-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLogIndex4.xml::20170503041528-1::user
2024-02-27 08:48:59,643 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex4.xml::20170503041528-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLogIndex5.xml::20170503041529-1::user
2024-02-27 08:48:59,648 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex5.xml::20170503041529-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLogIndex6.xml::20170503041530-1::user
2024-02-27 08:48:59,652 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex6.xml::20170503041530-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got mysql

Running Changeset: changeLog.xml::20170503041524-3::user
2024-02-27 08:48:59,709 [main] ERROR liquibase.changelog- ChangeSet changeLog.xml::20170503041524-3::user encountered an exception.
2024-02-27 08:48:59,717 [main] INFO  liquibase.command- Update command encountered an exception.
2024-02-27 08:48:59,724 [main] INFO  liquibase.lockservice- Successfully released change log lock
2024-02-27 08:48:59,724 [main] INFO  liquibase.command- Command execution complete
2024-02-27 08:48:59,864 [main] ERROR org.apache.catalina.core.StandardContext- One or more listeners failed to start. Full details will be found in the appropriate container log file
2024-02-27 08:48:59,865 [main] ERROR org.apache.catalina.core.StandardContext- Context [/perc-metadata-services] startup failed due to previous errors

On Derby:

-test\Deployment\Server\webapps\perc-metadata-services.war]
2024-02-29 12:08:39,409 [main] INFO  liquibase.servicelocator- Cannot load service: liquibase.change.Change: Provider liquibase.change.core.LoadDataChange could not be instantiated
2024-02-29 12:08:39,410 [main] INFO  liquibase.servicelocator- Cannot load service: liquibase.change.Change: Provider liquibase.change.core.LoadUpdateDataChange could not be instantiated
2024-02-29 12:08:40,039 [main] INFO  liquibase.changelog- Reading from APP.DATABASECHANGELOG
2024-02-29 12:08:40,170 [main] INFO  liquibase.lockservice- Successfully acquired change log lock
2024-02-29 12:08:40,177 [main] INFO  liquibase.command- Using deploymentId: 9226520176
2024-02-29 12:08:40,180 [main] INFO  liquibase.changelog- Reading from APP.DATABASECHANGELOG
Running Changeset: changeLogIndex1.xml::20170503041525-1::user
2024-02-29 12:08:40,196 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex1.xml::20170503041525-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Running Changeset: changeLogIndex2.xml::20170503041526-1::user
2024-02-29 12:08:40,201 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex2.xml::20170503041526-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Running Changeset: changeLogIndex3.xml::20170503041527-1::user
2024-02-29 12:08:40,203 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex3.xml::20170503041527-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Running Changeset: changeLogIndex4.xml::20170503041528-1::user
2024-02-29 12:08:40,204 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex4.xml::20170503041528-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Running Changeset: changeLogIndex5.xml::20170503041529-1::user
2024-02-29 12:08:40,205 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex5.xml::20170503041529-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Running Changeset: changeLogIndex6.xml::20170503041530-1::user
2024-02-29 12:08:40,207 [main] INFO  liquibase.changelog- Continuing past: changeLogIndex6.xml::20170503041530-1::user despite precondition failure due to onFail='CONTINUE':
          masterChangeLog.xml : DBMS Precondition failed: expected mssql, got derby

Expected behavior The metadata service should start correctly and the liquibase database migration that optimizes indexes for performance should be applied successfully on all database platforms.

Versions Affected

natechadwick commented 6 months ago

Note: See the same errors on the Derby database on Windows install of the DTS, but the metadata service still deploys, but the tables don't have the updated indexes.

I think the last error is what causes the failed deployment on mysql on linux.

Running Changeset: changeLog.xml::20170503041524-3::user
2024-02-27 08:48:59,709 [main] ERROR liquibase.changelog- ChangeSet changeLog.xml::20170503041524-3::user encountered an exception.
2024-02-27 08:48:59,717 [main] INFO  liquibase.command- Update command encountered an exception.
2024-02-27 08:48:59,724 [main] INFO  liquibase.lockservice- Successfully released change log lock
2024-02-27 08:48:59,724 [main] INFO  liquibase.command- Command execution complete
2024-02-27 08:48:59,864 [main] ERROR org.apache.catalina.core.StandardContext- One or more listeners failed to start. Full details will be found in the appropriate container log file
2024-02-27 08:48:59,865 [main] ERROR org.apache.catalina.core.StandardContext- Context [/perc-metadata-services] startup failed due to previous errors
rgarg24 commented 5 months ago

Hi Nate, there is issue related to DBMS Precondition failed: expected mysql, got mariadb in "masterChangeLog.xml" in case when database is mariadb.

1248

rgarg24 commented 5 months ago

Still getting error in case of linux environment: Caused by: liquibase.exception.DatabaseException: Table 'mysql_dts.blog_post_visit' doesn't exist [Failed SQL: (1146) ALTER TABLE mysql_dts.blog_post_visit MODIFY VISIT_ID BIGINT AUTO_INCREMENT]

rgarg24 commented 5 months ago

Hi Nate, This issue is happening as "blog_post_visit" table is case sensitive in case of linux. Actual table name should be "BLOG_POST_VISIT". Fixed by #1257