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

Mail Prepare Thread error occurred in some cases when triggering the mail sending job from Scheduler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 15.10.8, 16.2.0
    • 15.10.6, 16.1.0
    • Notifications
    • Windows 11 Pro, Chrome 122, using a local instance of XWiki 15.10.7 on Tomcat 9.0.86, MariaDB 11.3, reproducible also on Jetty
    • Integration
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      These are the steps after which I reproduced the issue the first time (on 15.10.7):

      1. Login as Admin
      2. Create an user (e.g. U1)
      3. Create some pages (e.g. a/b/c/d/e)
      4. Login as the user U1
      5. Go to Notifications Settings and create a filter or more (not sure this step is really relevant, but this is how I reproduced), e.g.: 
        1. Location -> Page "c": "Home/a/b/c/"
        2. Action -> Ignore the event
        3. Events type (Pages) -> A page is modified
        4. Channel -> Alert
      6. Login as Admin
      7. Update the pages a/b/c/d/e/
      8. Go to Scheduler.WebHome and trigger the 'Notifications daily email' job
      9. Observe the XWiki console

      Expected results

      No errors are displayed.

      Actual results

      In XWiki logs, there is the following stacktrace:

      2024-03-11 12:59:11,280 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45]
      2024-03-11 12:59:11,280 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.metaData.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 369, column 34]
      2024-03-11 12:59:11,280 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.attachments.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 375, column 37]
      2024-03-11 12:59:11,280 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.classProperties.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 387, column 41]
      2024-03-11 12:59:14,975 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45]
      2024-03-11 12:59:14,975 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.metaData.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 369, column 34]
      2024-03-11 12:59:14,975 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.attachments.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 375, column 37]
      2024-03-11 12:59:14,975 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.classProperties.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 387, column 41]
      2024-03-11 12:59:15,006 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45]
      2024-03-11 12:59:15,006 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.metaData.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 369, column 34]
      2024-03-11 12:59:15,006 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.attachments.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 375, column 37]
      2024-03-11 12:59:15,006 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.classProperties.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 387, column 41]
      2024-03-11 12:59:15,201 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45]
      2024-03-11 12:59:15,201 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.metaData.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 369, column 34]
      2024-03-11 12:59:15,201 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.attachments.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 375, column 37]
      2024-03-11 12:59:15,201 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.classProperties.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 387, column 41]
      2024-03-11 12:59:15,232 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45]
      2024-03-11 12:59:15,232 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.metaData.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 369, column 34]
      2024-03-11 12:59:15,232 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.attachments.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 375, column 37]
      2024-03-11 12:59:15,232 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($docDiff.classProperties.size()) of comparison operation has null value at environment:/templates/diff_macros.vm[line 387, column 41]
      2024-03-11 12:59:15,250 [Mail Prepare Thread] ERROR o.a.v.rendering                - Left side ($documentPropertiesSummary.modified) of comparison operation has null value at environment:/templates/diff_macros.vm[line 421, column 45

      Nevertheless, the mails are sent and received by the user.

      It is to be mentioned that I could not find a pattern to reproduce the issue consistently, but it seems I reproduced it every time after an upgrade (for ex from 12.10.11 to 15.10.6 and 15.10.7) by triggering the 'Notifications daily email' job just after (no Mail Sending configuration required), where on the instance upgraded there were also some attachments (images, office docs) added to the pages (but also, not sure this is relevant).

      The issue reproduced also on XWiki 16.1.0, but could not be reproduced on XWiki 14.10.21 and XWiki 15.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: