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

NPE when adding comments with CAPTCHA as guest user which prevents adding further comments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Solved By
    • Critical
    • None
    • 13.3, 12.10.7, 13.4
    • None
    • None
    • Windows 10 Pro 64 bit, Chrome 91, using a local instance of XWiki 13.4 (PostgreSQL 13/ Tomcat)
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Login as Admin
      2. Go to Administer Wiki > Users & Rights > Rights
      3. Check 'Require unregistered users to solve a CAPTCHA when posting a comment on a page'
      4. Create a page
      5. On that page, go to Administer Page > Users & Rights > Rights: Page > Users
      6. Grant 'Comment' right to Unregistered users
      7. Logout
      8. Add some comments as a guest user by filling the CAPTCHA

      EXPECTED RESULTS

      The comment are added successfully without errors.

      ACTUAL RESULTS

      Sometimes when adding a comment one after another or just at the first comment, it appears to be added, but if the page is refreshed, it disappears.

      In console, there is the following error:

      2021-06-04 11:26:47,996 [http-nio-8080-exec-2 - http://localhost:1113/bin/commentadd/Page8/WebHome?viewer=comments] WARN  c.x.x.w.XWikiAction            - Uncaught exception: Error number 3201 in 3: Exception while saving document xwiki:Page8.WebHome
      com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:Page8.WebHome
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:713)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:257)
              at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:217)
              at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:2055)
              at com.xpn.xwiki.web.CommentAddAction.action(CommentAddAction.java:120)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:588)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:286)
              at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:104)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:201)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:364)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1629)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: com.xpn.xwiki.XWikiException: Error number 3211 in 3: Exception while saving object Page8.WebHome
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiCollection(XWikiHibernateStore.java:1426)
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:685)
              ... 45 common frames omitted
      Caused by: java.lang.NullPointerException: null
              at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiCollection(XWikiHibernateStore.java:1395)
              ... 46 common frames omitted

      From this point, all further comments are not added anymore on all wiki pages from what I've tested (they appear to be added, but disappear once the page is refreshed), regardless if they are added with a guest or registered users.

      It is to be mentioned that the issue reproduces a bit randomly (couldn't find a direct pattern to reproduce it) and I've reproduced it on Chrome 91 and on Edge 91 and also on XWiki 13.3 and 12.10.7.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: