Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20738

Rollback to extension version breaks attachment in Sandbox

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 15.1
    • Old Core
    • None
    • Unknown

    Description

      Steps to reproduce:

      1. Go to the Sandbox and click on the History tab
      2. Roll back to "Version coming from extension Sandbox Application 15.1"
      3. Click on the attachments tab

      Expected result:

      The attached logo is displayed with a non-zero file size and is still displayed after a hard-refresh in the browser.

      Actual result:

      The attached logo is displayed with size 0 and isn't displayed anymore after a hard-refresh.

      After this, the rollback to certain versions also fails. In particular, the rollback to version 1.1 fails with the following exception. I assume this is a consequence of this bug and not a bug on its own:

       Detailed information:
      
          Error number 3201 in 3: Exception while saving document xwiki:Sandbox.WebHome
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:Sandbox.WebHome
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:729)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:259)
      	at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:219)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2096)
      	at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2001)
      	at com.xpn.xwiki.XWiki.rollback(XWiki.java:7669)
      	at com.xpn.xwiki.XWiki.rollback(XWiki.java:7507)
      	at com.xpn.xwiki.web.RollbackAction.action(RollbackAction.java:82)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:597)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:300)
      	at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:112)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
      	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
      	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:170)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1383)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1305)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:192)
      	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:51)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.Server.handle(Server.java:563)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:139)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:933)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1077)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: com.xpn.xwiki.XWikiException: Error number 3234 in 3: Exception while saving attachments attachment list of document xwiki:Sandbox.WebHome
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1877)
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:599)
      	... 68 more
      Caused by: com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachment [Attachment xwiki:Sandbox.WebHome@XWikiLogo.png]
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1948)
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachmentList(XWikiHibernateStore.java:1872)
      	... 69 more
      Caused by: com.xpn.xwiki.XWikiException: Error number 3232 in 3: Exception while saving attachment.
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.saveAttachmentContent(FilesystemAttachmentStore.java:124)
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveAttachment(XWikiHibernateStore.java:1933)
      	... 70 more
      Caused by: org.xwiki.store.TransactionException: Failure in onRun()
      Caused by:
      com.xpn.xwiki.XWikiException
      	Error number 0 in 3: Exception while hibernate execute
      
      	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:333)
      	at org.xwiki.store.StartableTransactionRunnable.start(StartableTransactionRunnable.java:54)
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore.saveAttachmentContent(FilesystemAttachmentStore.java:122)
      	... 71 more
      Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:835)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:948)
      	at com.xpn.xwiki.store.hibernate.HibernateAttachmentVersioningStore.saveArchive(HibernateAttachmentVersioningStore.java:98)
      	at org.xwiki.store.legacy.store.internal.FilesystemAttachmentStore$AttachmentSaveTransactionRunnable$1.onRun(FilesystemAttachmentStore.java:327)
      	at org.xwiki.store.TransactionRunnable.run(TransactionRunnable.java:318)
      	... 73 more
      Caused by: org.hibernate.MappingException: Unknown entity: com.xpn.xwiki.internal.doc.ListAttachmentArchive
      	at org.hibernate.metamodel.internal.MetamodelImpl.entityPersister(MetamodelImpl.java:715)
      	at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1653)
      	at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:293)
      	at org.hibernate.event.internal.EntityState.getEntityState(EntityState.java:59)
      	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:85)
      	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)
      	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
      	at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:652)
      	at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:645)
      	at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:640)
      	at org.hibernate.engine.spi.SessionDelegatorBaseImpl.saveOrUpdate(SessionDelegatorBaseImpl.java:845)
      	at com.xpn.xwiki.store.hibernate.HibernateAttachmentVersioningStore.lambda$saveArchive$1(HibernateAttachmentVersioningStore.java:99)
      	at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:826)
      	... 77 more
      

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: