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

Cannot insert Dashboard gadgets or re-arrange them anymore

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 14.2-rc-1
    • 14.1-rc-1
    • Dashboard
    • Windows 11 Pro 64 bit, Chrome 98, using a local instance of XWiki 14.1 RC1 on MariaDB 10.6, Tomcat 9.0.58 and Jetty+HSQLDB
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Go to Dashboard (from Applications Panel)
      2. Click 'Edit'
      3. Click 'Add Gadget' 
      4. Select a gadget (e.g. 'Box')
      5. Click 'Select'
      6. Write some content, then click 'Submit'
      7. Click 'Cancel' and edit the Dashboard page again
      8. Drag some existing gadgets to re-arrange them
      9. Click 'Save & View'

      EXPECTED RESULTS

      The gadget is added properly and the existing page gadgets can be re-arranged.

      ACTUAL RESULTS

      When click 'Add Gadget', the following error is displayed in browser's console:

      Uncaught TypeError: c(...).then(...).finally is not a function
          at dashboard.min.js?cache-version=1645537914000:11:187
          at Object.execCb (require.min.js?r=1:5:16727)
          at e.check (require.min.js?r=1:5:10499)
          at e.<anonymous> (require.min.js?r=1:5:12915)
          at require.min.js?r=1:5:1542
          at require.min.js?r=1:5:13376
          at each (require.min.js?r=1:5:1020)
          at emit (require.min.js?r=1:5:13344)
          at e.check (require.min.js?r=1:5:11058)
          at e.<anonymous> (require.min.js?r=1:5:12915)

      and the gadget is not added.

      Also, the page is not saved after re-arranging gadgets, at the bottom of the screen there is a Server Error displayed (see screenshot) and in XWiki console the following error is displayed:

      2022-02-28 17:31:45,423 [http-nio-1115-exec-5 - http://localhost:1115/xwiki/bin/save/Dashboard/WebHome] WARN  o.m.j.m.s.ErrorPacket          - Error: 1062-23000: Duplicate entry '4839681759241327529-10-1' for key 'PRIMARY'
      2022-02-28 17:31:45,425 [http-nio-1115-exec-5 - http://localhost:1115/xwiki/bin/save/Dashboard/WebHome] WARN  o.h.e.j.s.SqlExceptionHelper   - SQL Error: 1062, SQLState: 23000
      2022-02-28 17:31:45,425 [http-nio-1115-exec-5 - http://localhost:1115/xwiki/bin/save/Dashboard/WebHome] ERROR o.h.e.j.s.SqlExceptionHelper   - (conn=19) Duplicate entry '4839681759241327529-10-1' for key 'PRIMARY'
      2022-02-28 17:31:45,441 [http-nio-1115-exec-5 - http://localhost:1115/xwiki/bin/save/Dashboard/WebHome] WARN  c.x.x.w.XWikiAction            - Uncaught exception: Error number 3201 in 3: Exception while saving document xwiki:Dashboard.WebHome
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:Dashboard.WebHome
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:731)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:258)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:218)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2049)
              at com.xpn.xwiki.web.SaveAction.save(SaveAction.java:286)
              at com.xpn.xwiki.web.SaveAction.action(SaveAction.java:538)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:584)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:288)
              at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:115)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:359)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1735)
              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(Thread.java:833)
      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
              at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
              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:1406)
              at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:493)
              at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3285)
              at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2420)
              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:880)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:602)
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:722)
              ... 49 common frames omitted
      Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
              at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59)
              at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
              at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200)
              at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:46)
              at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3375)
              at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3908)
              at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:107)
              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(LinkedHashMap.java:721)
              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:1402)
              ... 60 common frames omitted
      Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=19) Duplicate entry '4839681759241327529-10-1' for key 'PRIMARY'
              at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:278)
              at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:358)
              at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:133)
              at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:807)
              at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:746)
              at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:665)
              at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:608)
              at org.mariadb.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:93)
              at org.mariadb.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:322)
              at org.mariadb.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:299)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
              at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
              ... 72 common frames omitted

       

      It is to be mentioned that when first navigating to Dashboard.WebHome, an info is displayed in browser's console:

      Failed to open the tree to node document:xwiki:Dashboard.WebHome.

      and an error (I've managed to reproduce it only on Jetty+HSQLDB it seems):

      Uncaught TypeError: element.dispatchEvent is not a function
          at fireEvent_DOM (prototype.js?r=1:7141:13)
          at fire (prototype.js?r=1:7130:17)
          at HTMLDocument._methodized [as fire] (prototype.js?r=1:456:23)
          at HTMLDocument.fireContentLoadedEvent (prototype.js?r=1:7317:14)

       but I don't know if it's related to this issue.

      The issue could not be reproduced on XWiki 14.0 or 13.10.3.

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: