Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-63782

Databases with multiple schemas incorrectly check for existing tables

    Details

      Description

      Description
      When upgrading a database with multiple schemas, checking if a table exists can return incorrect true or false causing an error during upgrade.

      Steps to reproduce

      1. Create database in postgres. (If using attached database back up, skip to step 10)
      2. Add two schema to newly created DB schema1 and schema2
      3. Create two login roles in postgres role1 and role2.
      4. Run ALTER ROLE role1 SET search_path = schema1; and ALTER ROLE role2 SET search_path = schema2; in postgresql.
      5. Start liferay 6.2 using role1 as database user credentials.
      6. Shut down liferay
      7. Start liferay 6.2 using role2 as database user credentials.
      8. Deploy Kaleo.
      9. Shutdown liferay.
      10. Upgrade liferay using role1 login credentials accessing schema 1

      Expected results
      Liferay would upgrade the role1 database schema without any errors.

      Actual results
      When upgrading, an error is thrown during Kaleo upgrade.

      15:27:12,467 INFO  [main][VerifyProcess:64] Verifying com.liferay.portal.verify.VerifyWorkflow
      15:27:12,468 INFO  [main][LoggingTimer:70] Starting com.liferay.portal.verify.VerifyWorkflow#deleteOrphaned
      15:27:12,475 ERROR [main][BaseDBProcess:154] org.postgresql.util.PSQLException: ERROR: relation "kaleoinstance" does not exist_  Position: 15 [Sanitized]
      org.postgresql.util.PSQLException: ERROR: relation "kaleoinstance" does not exist_  Position: 15 [Sanitized]
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2270)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1998)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:305)
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.hasColumn(BaseDBProcess.java:141)
      	at com.liferay.portal.verify.VerifyWorkflow.deleteOrphaned(VerifyWorkflow.java:36)
      	at com.liferay.portal.verify.VerifyWorkflow.doVerify(VerifyWorkflow.java:100)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:70)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:88)
      	at com.liferay.portal.verify.VerifyProcessSuite.doVerify(VerifyProcessSuite.java:49)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:70)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:113)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:78)
      	at com.liferay.portal.verify.VerifyProcessUtil.verifyProcess(VerifyProcessUtil.java:47)
      	at com.liferay.portal.events.StartupHelper.verifyProcess(StartupHelper.java:175)
      	at com.liferay.portal.events.StartupHelperUtil.verifyProcess(StartupHelperUtil.java:87)
      	at com.liferay.portal.tools.DBUpgrader.verify(DBUpgrader.java:252)
      	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:97)
      15:27:12,482 ERROR [main][BaseDBProcess:154] org.postgresql.util.PSQLException: ERROR: relation "kaleoinstancetoken" does not exist_  Position: 15 [Sanitized]
      org.postgresql.util.PSQLException: ERROR: relation "kaleoinstancetoken" does not exist_  Position: 15 [Sanitized]
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2270)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1998)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
      	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:305)
      	at com.liferay.portal.kernel.dao.db.BaseDBProcess.hasColumn(BaseDBProcess.java:141)
      	at com.liferay.portal.verify.VerifyWorkflow.deleteOrphaned(VerifyWorkflow.java:36)
      	at com.liferay.portal.verify.VerifyWorkflow.doVerify(VerifyWorkflow.java:100)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:70)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:88)
      	at com.liferay.portal.verify.VerifyProcessSuite.doVerify(VerifyProcessSuite.java:49)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:70)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:113)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:78)
      	at com.liferay.portal.verify.VerifyProcessUtil.verifyProcess(VerifyProcessUtil.java:47)
      	at com.liferay.portal.events.StartupHelper.verifyProcess(StartupHelper.java:175)
      	at com.liferay.portal.events.StartupHelperUtil.verifyProcess(StartupHelperUtil.java:87)
      	at com.liferay.portal.tools.DBUpgrader.verify(DBUpgrader.java:252)
      	at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:97)
      15:27:12,500 INFO  [main][LoggingTimer:38] Completed com.liferay.portal.verify.VerifyWorkflow#deleteOrphaned in 32 ms
      15:27:12,500 INFO  [main][VerifyProcess:79] Completed verification process com.liferay.portal.verify.VerifyWorkflow in 33ms
      15:27:12,500 INFO  [main][VerifyProcess:79] Completed verification process com.liferay.portal.verify.VerifyProcessSuite in 2651ms
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 25 weeks ago

                Packages

                Version Package
                7.0.0 DXP FP14
                7.0.0 DXP SP3
                7.0.3 CE GA4
                7.0.X EE
                Master