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

Unable to parse sub-calendars embedded in userinfo during indexing due to unexpected character

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      If a user has a character in their profile description, the XML parser for Team Calendars will throw this error message during the nightly or manually-triggered indexing tasks:

      2013-03-26 16:42:00,034 ERROR [scheduler_Worker-2] [confluence.extra.calendar3.DefaultEmbeddedSubCalendarsParser] getEmbeddedSubCalendarIds Unable to parse sub-calendars embedded in userinfo:
       admin v.3 (327681)
      com.atlassian.confluence.content.render.xhtml.XhtmlParsingException: The XML content could not be parsed. There is a problem at line 1, column 709. Parser message: Unexpected character ' 
      ' (code 32) (missing name?)
       at [row,col {unknown-source}]: [1,709]
              at com.atlassian.confluence.content.render.xhtml.StaxUtils.convertToXhtmlException(StaxUtils.java:327)
              at com.atlassian.confluence.content.render.xhtml.storage.StorageXhtmlTransformer.transform(StorageXhtmlTransformer.java:49)
              at com.atlassian.confluence.content.render.xhtml.DefaultXhtmlContent.handleMacroDefinitions(DefaultXhtmlContent.java:213)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
              at com.sun.proxy.$Proxy240.handleMacroDefinitions(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

      I used an ampersand in my testing, but other characters can cause the error as well. When I look at the description body stored in the database, the XHTML content is not escaped in any way, which I think breaks the XML parser that Team Calendars is using. This is my example userinfo:

       bodycontentid |       body       | contentid | bodytypeid 
      ---------------+------------------+-----------+------------
             1703938 | Hello & goodbye. |   1671170 |          0
             1703937 |                  |   1671169 |          0
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alaskowski Adam Laskowski (Inactive)
              Votes:
              15 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: