XWiki Platform
  1. XWiki Platform
  2. XWIKI-883

access right cannot be updated if too many users or groups selected

    Details

    • keywords:
      access preferences rights management DBImprovement
    • Similar issues:
      XWIKI-3548When renaming a user or a group, access rights are not updated
      XWIKI-7459Cannot access the object editor for documents with XWikiRights objects on wikis with many users
      XWIKI-345Access rights system cannot cope with a group name which includes space characters
      XWIKI-7148Delete right shown in the UI when delete right is not present but undelete right is present
      XWIKI-2375Group and user access rights problem with a name which includes space characters
      XWIKI-344Select with multiple=yes: cannot update to an empty selection
      XWIKI-5267New Right service implementation
      XWIKI-5830Too many open files
      XWIKI-929Add a more permissive access right
      XWIKI-2449Allow checking what groups a user belongs to using the Rights Management UI

      Description

      when i try to update the global access preferences of the wiki by adding one registered user to a group, it throw an exception, and the security configuration is not updated.
      note that the wiki is hosted on the xwiki farm (http://jguard.xwiki.com).

      thanks,
      Charles GAY.
      www.jguard.net

      here is the stack trace:
      "
      Detailed information:

      Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
      Wrapped Exception: could not update: [com.xpn.xwiki.objects.StringProperty#component[id,name]

      {name=users, id=1929900574}]
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document XWiki.XWikiPreferences
      Wrapped Exception: could not update: [com.xpn.xwiki.objects.StringProperty#component[id,name]{name=users, id=1929900574}

      ]
      at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:314)
      at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
      at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
      at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:909)
      at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:114)
      at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:123)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:143)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595)

      Wrapped Exception:

      com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'XWS_VALUE' at row 1
      at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:695)
      at com.mysql.jdbc.MysqlIO.scanForAndThrowDataTruncation(MysqlIO.java:3317)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1741)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
      at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2208)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:84)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
      at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:571)
      at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:545)
      at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:309)
      at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:100)
      at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:94)
      at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:909)
      at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:114)
      at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:123)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:143)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595"

        Issue Links

          Activity

          Hide
          Sergiu Dumitriu added a comment -

          This is because ListProperties are stored in a VARCHAR(255), with only 255 characters allowed, and the list of users does not fit in there.

          Show
          Sergiu Dumitriu added a comment - This is because ListProperties are stored in a VARCHAR(255), with only 255 characters allowed, and the list of users does not fit in there.
          Hide
          Artem Melentev added a comment -

          access preferences using UsersClass and GroupsClass, which creating (.newProperty()) StringProperty (255 chars)

          solutions:
          we can remove .newProperty method and use ListClass(superclass of Users/GroupsClass).newProperty which creating StringListProperty (60000 chars) if isMultiSelect() (In Users/GroupsClass this is always true)
          or we can simply write StringListProperty in Users/GroupsClass.newProperty

          Show
          Artem Melentev added a comment - access preferences using UsersClass and GroupsClass, which creating (.newProperty()) StringProperty (255 chars) solutions: we can remove .newProperty method and use ListClass(superclass of Users/GroupsClass).newProperty which creating StringListProperty (60000 chars) if isMultiSelect() (In Users/GroupsClass this is always true) or we can simply write StringListProperty in Users/GroupsClass.newProperty
          Hide
          Artem Melentev added a comment -

          The problem can be fixed by changing StringProperty to LargeStringProperty in Users/GroupsClass
          But the new problem is occured: old data need to be converted by using LargeStringProperty in Users/GroupsClass. Otherwise we will get many exceptions.

          Show
          Artem Melentev added a comment - The problem can be fixed by changing StringProperty to LargeStringProperty in Users/GroupsClass But the new problem is occured: old data need to be converted by using LargeStringProperty in Users/GroupsClass. Otherwise we will get many exceptions.
          Hide
          Vincent Massol added a comment -

          Assigning to Artem as he seems to be working on it. Thanks Artem!

          Show
          Vincent Massol added a comment - Assigning to Artem as he seems to be working on it. Thanks Artem!
          Hide
          Artem Melentev added a comment -

          Attached patch xwiki-platform-core-XWIKI-883.patch:
          Changed StringProperty to LargeStringProperty in Users/GroupsClass
          Added hibernate data migration like UpdateSchema but using hql instead of sql
          Tested on pgsql and mysql (hsql has immunity)

          I don't like this solution
          Maybe another way is?

          Show
          Artem Melentev added a comment - Attached patch xwiki-platform-core- XWIKI-883 .patch: Changed StringProperty to LargeStringProperty in Users/GroupsClass Added hibernate data migration like UpdateSchema but using hql instead of sql Tested on pgsql and mysql (hsql has immunity) I don't like this solution Maybe another way is?
          Hide
          Artem Melentev added a comment -

          fixed in r4345.
          added migration for data update.

          Show
          Artem Melentev added a comment - fixed in r4345. added migration for data update.

            People

            • Assignee:
              Artem Melentev
              Reporter:
              charles gay
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: