6dfd011db329, here is the status update of the issue.
Root cause:
The ConfiForm macro tries to convert its own XHTML fragment to storage format even though it is already in storage format.
Details:
- Confluence renders a page for view.
- Confluence calls com.atlassian.confluence.macro.Macro#execute for each macro on the page.
- ConfiForm macro implements this method and somewhere inside implementation calls com.atlassian.confluence.content.render.xhtml.FormatConverter#convertToStorageFormat with incorrect first argument, which is already in storage format. This is where the bug happens.
- The confluence-unknown-attachments-reconciliation-plugin installs format transformers: storageToView, storageToEditor, editorToStorage. (The plugin handles representation of unknown attachments in various formats.)
- The plugin tries to use editorToStorage transformer on input in storage format. The transformer's XML reader fails to parse the input and throws an exception. Older version of XML parser used to throw com.ctc.wstx.exc.WstxLazyException; new version throws com.ctc.wstx.exc.WstxParsingException.
In the past we introduced a patch inside confluence-unknown-attachments-reconciliation-plugin by converting WstxLazyException to com.atlassian.confluence.content.render.xhtml.XhtmlException. It seems that ConfiForm macro can handle XhtmlException and somehow recover from it.
After upgrading XML parsing library in Confluence 8.0, the patch does not work since the exception type changed.
Solution:
- I'm going to harden the confluence-unknown-attachments-reconciliation-plugin: when its transformers fail parsing given XHTML input, then they will throw XhtmlException only.
- At the same time you should fix the ConfiForms macro and stop calling FormatConverter#convertToStorageFormat with an input that is already in storage format.
I attached a thread dump of the process where you can see the call stack. The thread name is "http-nio-1990-exec-6@54925".
For your convenience I'm inserting relevant part of the call stack in this comment, as well.
"http-nio-1990-exec-6@54925" daemon prio=5 tid=0x15f nid=NA runnable
java.lang.Thread.State: RUNNABLE
at com.atlassian.confluence.plugins.attachment.reconciliation.marshalling.UnknownAttachmentTransformerBase.transform(UnknownAttachmentTransformerBase.java:61)
at com.atlassian.confluence.plugins.attachment.reconciliation.marshalling.UnknownAttachmentTransformerEditorToStorage.transform(UnknownAttachmentTransformerEditorToStorage.java:30)
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.editor.DefaultEditorConverter.convert(DefaultEditorConverter.java:37)
at com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter.convertToStorageFormat(DefaultFormatConverter.java:123)
[...]
at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
at com.sun.proxy.$Proxy565.convertToStorageFormat(Unknown Source:-1)
[...]
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:130)
at com.sun.proxy.$Proxy565.convertToStorageFormat(Unknown Source:-1)
at com.vertuna.confluence.plugins.confiforms.action.BaseAction.tryToGetBody(BaseAction.java:963)
at com.vertuna.confluence.plugins.confiforms.action.BaseAction.getConfiFormsPage(BaseAction.java:827)
at com.vertuna.confluence.plugins.confiforms.AbstractConfiFormMacro.getConfiFormsPage(AbstractConfiFormMacro.java:197)
at com.vertuna.confluence.plugins.confiforms.ConfiFormMacro.executeToStream(ConfiFormMacro.java:65)
[...]
at com.atlassian.confluence.pages.actions.ViewPageAction.execute(ViewPageAction.java:177)
[...]
Thread dump: threads_report.txt
A fix for this issue is available in Confluence Server and Data Center 8.0.3.
Upgrade now or check out the Release Notes to see what other issues are resolved.