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

Errors when setting Extension Rights or Wikis Creation Rights

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 15.3-rc-1, 14.10.8
    • 15.1, 14.10.6
    • Administration
    • Windows 11 Pro, Edge 111, using a local instance of XWiki 14.10.7 on MariaDB 10.11, Tomcat 9.0.73, reproducible also on Jetty/HSQLDB
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Login as Admin
      2. Go to Administer Wiki > Wikis > Creation Right (can be reproduced also from Administer Wiki > Users & Rights > Extension Rights or Administer Page > Users & Rights > Extension Rights)
      3. Set a right for an user or a group

      Expected results

      The right is set and displayed properly.

      Actual results

      When clicking to set a right, the page redirects to the main Administration Level menu and in many cases the setting is not saved.

      If the right is modified again, or from Deny to Blank (on which I've reproduced most of the times), an error is displayed on the browser (partial stacktrace):

      Notice: A problem occurred while trying to process your request. Please contact the webmaster if this happens again.
      
      Detailed information:
          Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiPreferences
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiPreferences
      	at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:732)
      	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.web.SaveAction.save(SaveAction.java:298)
      	at com.xpn.xwiki.web.SaveAndContinueAction.doWrappedAction(SaveAndContinueAction.java:126)
      	at com.xpn.xwiki.web.SaveAndContinueAction.action(SaveAndContinueAction.java:199)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:598)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:301)
      	at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update xwikiobjects set XWO_NUMBER=?, XWO_NAME=?, XWO_CLASSNAME=?, XWO_GUID=? where XWO_ID=?
      	at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:238)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:93)
      [.....]

       

      with the following stacktrace in XWiki console:
       

      2023-03-28 14:57:18,955 [http-nio-8080-exec-10 - http://localhost:1113/bin/saveandcontinue/XWiki/XWikiPreferences] WARN  c.x.x.w.XWikiAction            - Uncaught exception: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiPreferences
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiPreferences
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:732)
              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.web.SaveAction.save(SaveAction.java:298)
              at com.xpn.xwiki.web.SaveAndContinueAction.doWrappedAction(SaveAndContinueAction.java:126)
              at com.xpn.xwiki.web.SaveAndContinueAction.action(SaveAndContinueAction.java:199)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:598)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:301)
              at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
              at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update xwikiobjects set XWO_NUMBER=?, XWO_NAME=?, XWO_CLASSNAME=?, XWO_GUID=? where XWO_ID=?
              at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:238)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:93)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1411)
              at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:489)
              at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3303)
              at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2438)
              at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
              at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281)
              at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
              at com.xpn.xwiki.internal.store.hibernate.HibernateStore.endTransaction(HibernateStore.java:918)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:602)
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:712)
              ... 50 common frames omitted
      Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update xwikiobjects set XWO_NUMBER=?, XWO_NAME=?, XWO_CLASSNAME=?, XWO_GUID=? where XWO_ID=?
              at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:67)
              at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:54)
              at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:47)
              at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3571)
              at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3438)
              at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3870)
              at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:202)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
              at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478)
              at java.base/java.util.LinkedHashMap.forEach(Unknown Source)
              at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475)
              at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344)
              at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40)
              at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
              at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1407)
              ... 61 common frames omitted

      If the instance is restarted, the Rights checkboxes are missing (reproduced on Jetty/HSQL), see screenshots.

      The issue reproduces on XWiki 14.10.6, 14.10.7, 15.1 and 15.2, but could not be reproduced on XWiki 14.10.5.

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: