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

Missing information in upgrade's log when running Gogo commands

    Details

      Description

      In case of exception when running an upgrade process from the Gogo console, the specific error and the stacktrace are not logged either in the console or in the upgrade logs.
      You can only find this information in Liferay logs, which is not very intuitive.

      Steps to reproduce

      1. In a 7.2 database, execute the following query in order to cause an upgrade exception:

      update release_ set schemaversion = "1.0.1" where servletcontextname = 'com.liferay.journal.service'

      In master:

      1. Create a file called com.liferay.portal.upgrade.internal.configuration.ReleaseManagerConfiguration.cfg in LIFERAY_HOME/osgi/configs/
      2. Add autoUpgrade=false inside of previous created file.
      3. Execute the upgrade: java -jar com.liferay.portal.tools.db.upgrade.client.jar
      4. Wait until the core upgrade finishes and Gogo Shell is open.
      5. Execute, from the Gogo Shell, upgrade:executeAll

       

      Expected result: a complete stacktrace is found at least in the upgrade logs:

       

      g! upgrade:executeAll                                                                                                                                                                                                                        INFO - Upgrading com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent                                                                                                                                                         INFO - Starting com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent#copyJournalArticleImagesToJournalRepository                                                                                                              INFO - Completed com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent#copyJournalArticleImagesToJournalRepository in 1 ms                                                                                                     INFO - Failed upgrade process com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent in 3 ms                                                                                                                                    ERROR - Failed upgrade process for module com.liferay.journal.service                                                                                                                                                                        com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: Table 'lportal_oami.journalarticleimage' doesn't exist 
       at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:110)
       ....
      Caused by: java.sql.SQLSyntaxErrorException: Table 'lportal.journalarticleimage' doesn't exist                                                                                                                                                  at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)                                                                                                                                                               at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)                                                                                                                                                                at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)                                                                                                                                       at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1218)                                                                                                                                                                     at com.zaxxer.hikari.pool.ProxyStatement.executeQuery(ProxyStatement.java:108)                                                                                                                                                               at com.zaxxer.hikari.pool.HikariProxyStatement.executeQuery(HikariProxyStatement.java)                                                                                                                                                       at com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent.copyJournalArticleImagesToJournalRepository(UpgradeImageTypeContent.java:79)                                                                                          at com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent.doUpgrade(UpgradeImageTypeContent.java:122)                                                                                                                           at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:96)  

       

      Current result: we can only find the following information in the  logs or console:

       

      g! upgrade:executeAll                                                                                                                                                                                                                                                                                                                                               INFO - Upgrading com.liferay.journal.internal.upgrade.v1_1_0.UpgradeDocumentLibraryTypeContent                                                                                                                                               INFO - Starting com.liferay.journal.internal.upgrade.v1_1_0.UpgradeDocumentLibraryTypeContent#updateContent                                                                                                                                  INFO - Completed com.liferay.journal.internal.upgrade.v1_1_0.UpgradeDocumentLibraryTypeContent#updateContent in 2 ms                                                                                                                         INFO - Completed upgrade process com.liferay.journal.internal.upgrade.v1_1_0.UpgradeDocumentLibraryTypeContent in 5 ms                                                                                                                       INFO - Upgrading com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent                                                                                                                                                         INFO - Starting com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent#copyJournalArticleImagesToJournalRepository                                                                                                              INFO - Completed com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent#copyJournalArticleImagesToJournalRepository in 3 ms                                                                                                     INFO - Failed upgrade process com.liferay.journal.internal.upgrade.v1_1_0.UpgradeImageTypeContent in 4 ms                                                                                                                                    The following modules had errors while upgrading:                                                                                                                                                                                                    com.liferay.journal.service                                                                                                                                                                                                          Use the command upgrade:list <module name> to get more details about the status of a specific upgrade.

       

      Note: If we run the entire process at once (autoUpgrade = true), the complete stacktrace is logged in upgrade's log.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  9 weeks, 1 day ago

                  Packages

                  Version Package
                  7.1.X
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.X
                  7.2.1 CE GA2
                  Master