Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-57660

Email Notification for User Mention broken when specific characters are in the page body

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: High High
    • None
    • 6.3.1, 6.11.2, 6.13.0, 6.13.8, 6.15.9, 7.3.4, 7.4.1, 7.19.5
    • None

      Problem

      Email Notification when a user is mentioned can break when the page body contains some special characters

      Steps to reproduce

      1. Setup Confluence with SMTP Mail Server
      2. Create a Page using the Storage Format below:
        table storage format.txt
      3. Mention a user in the Comments column

      Expected Result

      Email notification received by the mentioned user should include the page body content normally

      Actual Result

      Error message below is in the email notification

      Error: [com.ctc.wstx.exc.WstxLazyException] Unexpected character '<' (code 60) excepted space, or '>' or "/>" at [row,col {unknown-source}]: [1,327]
      

      Also, when the affected page is updated, there could be an entry in atlassian-confluence.log similar to the below excerpt:

      2020-05-04 17:08:30,488 ERROR [http-nio2-8090-exec-67] [content.render.xhtml.DefaultRenderer] renderWithoutMetrics Error rendering content for view: The XML content could not be parsed. There is a problem at line 1, column 383. Parser message: Unexpected character &#39;&lt;&#39; (code 60) excepted space, or &#39;&gt;&#39; or &quot;/&gt;&quot;
       at [row,col {unknown-source}]: [1,383]
       -- referer: <Confluence Base URL>/pages/resumedraft.action?draftId=579891886&draftShareId=223a2089-01a0-4e95-b56a-042d59d219f5& | url: /rest/api/content/<pageID> | traceId: a0bc99d8a8b0a1e5 | userName: <username>
      com.atlassian.confluence.content.render.xhtml.XhtmlParsingException: The XML content could not be parsed. There is a problem at line 1, column 383. Parser message: Unexpected character &#39;&lt;&#39; (code 60) excepted space, or &#39;&gt;&#39; or &quot;/&gt;&quot;
       at [row,col {unknown-source}]: [1,383]
      	at com.atlassian.confluence.content.render.xhtml.StaxUtils.convertToXhtmlException(StaxUtils.java:433)
      	at com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody.InlineBodyMacroFixingTransformer.transform(InlineBodyMacroFixingTransformer.java:114)
      	at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
      	at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
      	at com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:39)
      	at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.renderWithoutMetrics(DefaultRenderer.java:189)
      	at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.renderWithResult(DefaultRenderer.java:150)
      	at com.atlassian.confluence.content.render.xhtml.DefaultRenderer.render(DefaultRenderer.java:134)
      	at com.atlassian.confluence.content.render.xhtml.DeviceTypeAwareRenderer.render(DeviceTypeAwareRenderer.java:55)
      	at jdk.internal.reflect.GeneratedMethodAccessor1335.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      (...)
      	at com.sun.proxy.$Proxy150.saveContentEntity(Unknown Source)
      	at com.atlassian.confluence.content.apisupport.ContentCreator.saveNewVersion(ContentCreator.java:507)
      	at com.atlassian.confluence.content.apisupport.ContentCreator.update(ContentCreator.java:554)
      	at com.atlassian.confluence.api.impl.service.content.typebinding.PageContentTypeApiSupport.update(PageContentTypeApiSupport.java:219)
      	at com.atlassian.confluence.api.impl.service.content.typebinding.PageContentTypeApiSupport.update(PageContentTypeApiSupport.java:47)
      	at com.atlassian.confluence.api.impl.service.content.ContentServiceImpl.updateUsingApiSupport(ContentServiceImpl.java:127)
      	at com.atlassian.confluence.api.impl.service.content.ContentServiceImpl.update(ContentServiceImpl.java:165)
      (...)
      	at com.sun.proxy.$Proxy220.update(Unknown Source)
      	at com.atlassian.confluence.api.impl.service.content.draft.SharedContentDraftServiceImpl.updateContent(SharedContentDraftServiceImpl.java:235)
      	at com.atlassian.confluence.api.impl.service.content.draft.SharedContentDraftServiceImpl.publishEditDraft(SharedContentDraftServiceImpl.java:163)
      	at com.atlassian.confluence.api.impl.service.content.draft.ContentDraftServiceImpl.publishEditDraft(ContentDraftServiceImpl.java:40)
      	at jdk.internal.reflect.GeneratedMethodAccessor2596.invoke(Unknown Source)
      (...)
      	at com.sun.proxy.$Proxy226.publishEditDraft(Unknown Source)
      	at jdk.internal.reflect.GeneratedMethodAccessor2596.invoke(Unknown Source)
      (...)
      	at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60) excepted space, or '>' or "/>"
       at [row,col {unknown-source}]: [1,383]
      	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
      	at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2965)
      	at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2936)
      	at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
      	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
      	at com.ctc.wstx.evt.WstxEventReader.peek(WstxEventReader.java:306)
      	at com.ctc.wstx.evt.FilteredEventReader.peek(FilteredEventReader.java:120)
      	at com.ctc.wstx.evt.FilteredEventReader.hasNext(FilteredEventReader.java:70)
      	at com.atlassian.confluence.content.render.xhtml.XmlFragmentBodyEventReader.hasNext(XmlFragmentBodyEventReader.java:33)
      	at com.atlassian.confluence.content.render.xhtml.ResettableXmlEventReader.hasNext(ResettableXmlEventReader.java:48)
      	at com.atlassian.confluence.content.render.xhtml.storage.macro.inlinebody.InlineBodyMacroFixingTransformer.transform(InlineBodyMacroFixingTransformer.java:84)
      	... 456 more
      

      Suggestion

      The email notification should be able to handle this since the Storage Format can be inserted using the Source Editor without complaining of any missing tags.

      Workaround

      As mentioned by Katharina below, a workaround is to remove the styling parameter from the <tbody> using the Source Editor plugin.

        1. table storage format.txt
          2 kB
          Damien Tan
        2. email notification.JPG
          34 kB
          Damien Tan

            [CONFSERVER-57660] Email Notification for User Mention broken when specific characters are in the page body

            a65b0641cad9 As per the previous comments, this issue is tracked by another card and has been fixed in our LTS releases since June.

            Kusal Kithul-Godage added a comment - a65b0641cad9 As per the previous comments, this issue is tracked by another card and has been fixed in our LTS releases since June.

            Also affects Confluence version 7.19.9

            Can you tell me, why this ticket is in state "closed".

            Does this mean the bug will not be fixed for server/datacenter versions?

            Jürgen Buchinger added a comment - Also affects Confluence version 7.19.9 Can you tell me, why this ticket is in state "closed". Does this mean the bug will not be fixed for server/datacenter versions?

            Will this not be in the latest LTS release?

            Jason D Smith added a comment - Will this not be in the latest LTS release?

            Hi 0b54ff294168,

            I'm not sure how you've come to that understanding.

            We identified the same issue independently of this ticket. We opened a new issue to track the problem and fixed it. We then became aware of this pre-existing ticket. We investigated and determined that the root cause of both tickets was the same. For simplicities sake we closed this ticket because all our pull requests are against the other ticket.

            The fix is awaiting release in Confluence 8.3.0 which is due next week.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hi 0b54ff294168 , I'm not sure how you've come to that understanding. We identified the same issue independently of this ticket. We opened a new issue to track the problem and fixed it. We then became aware of this pre-existing ticket. We investigated and determined that the root cause of both tickets was the same. For simplicities sake we closed this ticket because all our pull requests are against the other ticket. The fix is awaiting release in Confluence 8.3.0 which is due next week. Thanks, James Ponting Engineering Manager - Confluence Data Center

            So Atlassian is saying, let's reset the counter of "gardening interest" and age for this particular issue since we did some change that might do nothing to the problem described here?

            How .... 

            //Tomas

            Tomas Karas added a comment - So Atlassian is saying, let's reset the counter of "gardening interest" and age for this particular issue since we did some change that might do nothing to the problem described here? How ....  //Tomas

            Hi All,

            I'm going to close this one as a duplicate.

            We came across this issue whilst upgrading the Woodstox library. As a result we opened a ticket and implemented a fix which is at CONFSERVER-82863: Email notification is corrupt for a user mentioned within a table of a page (fixed in Confluence Server and Data Center 8.3.0).

            As a result I'm going to close this ticket as a duplicate (even though it's the other way around). I've bumped the priority of the other ticket to ensure it gets backported.

            Thanks,
            James Ponting
            Engineering Manager - Confluence Data Center

            James Ponting added a comment - Hi All, I'm going to close this one as a duplicate. We came across this issue whilst upgrading the Woodstox library. As a result we opened a ticket and implemented a fix which is at CONFSERVER-82863: Email notification is corrupt for a user mentioned within a table of a page (fixed in Confluence Server and Data Center 8.3.0) . As a result I'm going to close this ticket as a duplicate (even though it's the other way around). I've bumped the priority of the other ticket to ensure it gets backported. Thanks, James Ponting Engineering Manager - Confluence Data Center

            Same problem on Confluence server 7.19.6 

             

            Kasia Olchawa added a comment - Same problem on Confluence server 7.19.6   

            Removing the empty class attribute from the table using the source editor plugin (which is actually not DC-ready) seems to fix the issue.

            The beginning of my table - before:

            <table class="wrapped">
              <colgroup class="">
                <col class=""/>
                <col class=""/>
                <col class=""/>
                <col class=""/>
              </colgroup>
              <tbody class="">
                <tr class="">
            

            and after:

            <table class="wrapped">
              <colgroup>
                <col />
                <col />
                <col />
                <col />
              </colgroup>
              <tbody>
                <tr>
            

            But this problem also looks nasty and I hope that we don´t have to wait another 4 years for a fix.

            Christian Schlaefcke added a comment - Removing the empty class attribute from the table using the source editor plugin ( which is actually not DC-ready ) seems to fix the issue. The beginning of my table - before: <table class= "wrapped" > <colgroup class=""> <col class=""/> <col class=""/> <col class=""/> <col class=""/> </colgroup> <tbody class=""> <tr class=""> and after: <table class= "wrapped" > <colgroup> <col /> <col /> <col /> <col /> </colgroup> <tbody> <tr> But this problem also looks nasty and I hope that we don´t have to wait another 4 years for a fix.

            Christian Schlaefcke added a comment - - edited

            I see this problem also witout style attribute (DC 7.19.5):

            <tbody class="">

            I have just a table containing mentions and the status makro in each row

            Christian Schlaefcke added a comment - - edited I see this problem also witout style attribute (DC 7.19.5): <tbody class=""> I have just a table containing mentions and the status makro in each row

            Robert added a comment - - edited

            Same problem on Confluence DC 7.19.5
            If table have some text formatting and contains a mention

            Robert added a comment - - edited Same problem on Confluence DC 7.19.5 If table have some text formatting and contains a mention

              Unassigned Unassigned
              btan@atlassian.com Damien Tan
              Affected customers:
              71 This affects my team
              Watchers:
              61 Start watching this issue

                Created:
                Updated:
                Resolved: