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

When creating a site from a site template containing document and media portlet, sometimes an error is thrown

    Details

      Description

      When creating a site from a site template containing the document and media portlet with some DLFiles, sometimes the following error is thrown:

      11:57:34,249 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] Batch entry 0 insert into RatingsStats (classNameId, classPK, totalEntries, totalScore, averageScore, statsId) values ('20011', '212634', '0', '0.0', '0.0', '212782') was aborted.  Call getNextException to see the cause.
      11:57:34,260 ERROR [liferay/background_task-1][JDBCExceptionReporter:82] ERROR: duplicate key value violates unique constraint "ix_a6e99284"_  Detail: Key (classnameid, classpk)=(20011, 212634) already exists. [Sanitized]
      11:57:34,295 ERROR [liferay/background_task-1][DefaultTransactionExecutor:93] Application exception overridden by commit exception
      org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [insert into RatingsStats (classNameId, classPK, totalEntries, totalScore, averageScore, statsId) values (?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
          at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:637)
          at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793)
          at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:664)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
          at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.processCommit(DefaultTransactionExecutor.java:82)
          at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:70)
          at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
          at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
          at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
          at com.sun.proxy.$Proxy166.addStats(Unknown Source)
          at com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl.getStats(RatingsStatsLocalServiceImpl.java:113)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
          at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
          at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
          at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
          at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
          at com.sun.proxy.$Proxy166.getStats(Unknown Source)
          at com.liferay.portlet.ratings.service.RatingsStatsLocalServiceUtil.getStats(RatingsStatsLocalServiceUtil.java:301)
          at com.liferay.portal.kernel.search.BaseIndexer.addAssetFields(BaseIndexer.java:617)
          at com.liferay.portal.kernel.search.BaseIndexer.getBaseModelDocument(BaseIndexer.java:1582)
          at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doGetDocument(DLFileEntryIndexer.java:357)
          at com.liferay.portal.kernel.search.BaseIndexer.getDocument(BaseIndexer.java:153)
          at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doReindex(DLFileEntryIndexer.java:493)
          at com.liferay.portlet.documentlibrary.util.DLFileEntryIndexer.doReindex(DLFileEntryIndexer.java:506)
          at com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:466)
          at com.liferay.portal.lar.backgroundtask.StagingIndexingBackgroundTaskExecutor.execute(StagingIndexingBackgroundTaskExecutor.java:124)
          at com.liferay.portal.kernel.backgroundtask.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:56)
          at com.liferay.portal.backgroundtask.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:108)
          at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
          at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
          at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:71)
          at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
          at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
          at java.lang.Thread.run(Thread.java:662)
      Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
          at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
          at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
          at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
          ... 36 more
      
      

      Steps to reproduce:
      1.- Create a site template with a page containing the Documents and Media portlet.
      2.- Upload an image to the Documents and Media portlet.
      3.- Create a site based on the site template.

      *As the error is not always thrown, step 3 must be repeated until the error is thrown.


      Resolved in master/7.0 as part of LPS-56669 in this commit: https://github.com/liferay/liferay-portal/commit/daf89b7e9ef69ec7a988b75483376732239a4240

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ian.song Ian Song (Inactive)
                Reporter:
                eduardo.perez Eduardo Perez (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 33 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.X EE