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

Several misleading errors can occur in LayoutUpgradeProcess

Details

    Description

      com.liferay.layout.page.template.internal.upgrade.v2_1_0.LayoutUpgradeProcess performs in one step both schema upgrade and functional upgrade. So, if the process fails in the second part there is no code to check if alter was performed before. Besides the fallback recreation process is invoked with the old table structure which makes it invalid.

      This can cause the following exceptions to be obtained alternatively:

      g! upgrade:execute com.liferay.layout.page.template.service
      INFO - Upgrading com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout
      INFO - Starting com.liferay.portal.kernel.upgrade.UpgradeProcess#alter
      INFO - Completed com.liferay.portal.kernel.upgrade.UpgradeProcess#alter in 875 ms
      INFO - Starting com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout#upgradeLayout
      INFO - Completed com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout#upgradeLayout in 171 ms
      INFO - Failed upgrade process com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout in 1082 ms
      ERROR - Failed upgrade process for module com.liferay.layout.page.template.service
      com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.exception.NoSuchLayoutException: {groupId=292680}
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:109)
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:127)
       at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor$UpgradeInfosRunnable.run(UpgradeExecutor.java:200)
       at com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:134)
       at com.liferay.portal.upgrade.internal.executor.SwappedLogExecutor.execute(SwappedLogExecutor.java:51)
       at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:155)
       at com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.execute(UpgradeExecutor.java:118)
       at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.execute(ReleaseManagerOSGiCommands.java:81)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
       at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
       at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
       at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
       at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
       at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.exception.NoSuchLayoutException: {groupId=292680}
       at com.liferay.portal.model.impl.LayoutPrototypeImpl.getLayout(LayoutPrototypeImpl.java:55)
       at com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout._getPlid(UpgradeLayout.java:155)
       at com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout.upgradeLayout(UpgradeLayout.java:91)
       at com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout.doUpgrade(UpgradeLayout.java:64)
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:104)
       ... 23 more
      g! upgrade:execute com.liferay.layout.page.template.service
      INFO - Upgrading com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout
      INFO - Starting com.liferay.portal.kernel.upgrade.UpgradeProcess#alter
      WARN - Attempting to upgrade table LayoutPageTemplateEntry by recreating the table due to: Duplicate column name 'plid'
      INFO - Starting com.liferay.portal.kernel.upgrade.UpgradeProcess#upgradeTable#LayoutPageTemplateEntry
      INFO - Starting backup of LayoutPageTemplateEntry to /opt/liferay/tomcat/temp/temp-db-LayoutPageTemplateEntry-2021686010056683655.tmp
      INFO - Finished backup of LayoutPageTemplateEntry to /opt/liferay/tomcat/temp/temp-db-LayoutPageTemplateEntry-2021686010056683655.tmp in 20 ms
      INFO - Completed com.liferay.portal.kernel.upgrade.UpgradeProcess#upgradeTable#LayoutPageTemplateEntry in 527 ms
      WARN - Successfully recreated and upgraded table LayoutPageTemplateEntry
      INFO - Completed com.liferay.portal.kernel.upgrade.UpgradeProcess#alter in 555 ms
      INFO - Starting com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout#upgradeLayout
      INFO - Completed com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout#upgradeLayout in 2 ms
      INFO - Failed upgrade process com.liferay.layout.page.template.internal.upgrade.v2_1_0.UpgradeLayout in 558 ms
      ERROR - Failed upgrade process for module com.liferay.layout.page.template.service
      com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLSyntaxErrorException: Unknown column 'plid' in 'where clause'
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:109)
       at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:127)
      

      Attachments

        Issue Links

          Activity

            People

              summer.zhang Summer Zhang
              mariano.alvaro Mariano Álvaro
              Marta Elicegui Marta Elicegui
              Mariano Álvaro Mariano Álvaro
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1 year, 33 weeks ago

                Packages

                  Version Package
                  7.2.10 DXP FP13
                  7.2.X
                  7.3.7 CE GA8
                  7.3.10 DXP FP2
                  7.3.X
                  7.4.0 CE GA1 DXP 7,4
                  7.4.13 DXP GA1
                  Master