Comparing Page Versions Fails Due to Timeout Exceeded
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
This page only applies for Confluence 4.x or higher, since page comparison is handled differently in Confluence 3.5.x or lower.
Comparing two page versions is failing with the following error:
OR
The following appears in the atlassian-confluence.log
:
WARN [http-8790-1] [confluence.pages.actions.AbstractDiffPagesAction] execute Error while generating diff: (page: Koopia LEP_1.2 Lepingu lisamine (värvitud) v.52 (592359) vs page: LEP_1.2 Lepingu lisamine v.82 (591818))
-- url: /pages/diffpagesbyversion.action | page: 590034 | userName: admin | referer: http://localhost:8790/pages/viewpreviousversions.action?pageId=590034 | action: diffpagesbyversion
OR
ERROR [TP-Processor10] [confluence.pages.actions.AbstractDiffPagesAction] execute Error while generating diff: (page: IT-Betrieb___Spotlight Jahre 2008 bis 2010 v.1 (6980160) vs page: IT-Betrieb___Spotlight Jahre 2008 bis 2012 v.2 (5083797))
-- url: /confluence/pages/diffpagesbyversion.action | page: 5083797 | userName: admin | referer: http://localhost:879/confluence/pages/viewpreviousversions.action?pageId=5083797 | action: diffpagesbyversion
com.atlassian.confluence.diff.DiffException: Index: 7942, Size: 7942
at com.atlassian.confluence.diff.DaisyHtmlDiffer.createOrGetFutureDiff(DaisyHtmlDiffer.java:154)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.diff(DaisyHtmlDiffer.java:97)
at com.atlassian.confluence.diff.WikiConvertingHtmlDiffer.diff(WikiConvertingHtmlDiffer.java:31)
at com.atlassian.confluence.pages.actions.AbstractDiffPagesAction.execute(AbstractDiffPagesAction.java:83)
Caused by: java.lang.IndexOutOfBoundsException: Index: 7942, Size: 7942
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.outerj.daisy.diff.html.TextNodeComparator.getTextNode(TextNodeComparator.java:67)
at org.outerj.daisy.diff.html.TextNodeComparator.handlePossibleChangedPart(TextNodeComparator.java:136)
at org.outerj.daisy.diff.html.HTMLDiffer.diff(HTMLDiffer.java:81)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.diff(DaisyHtmlDiffer.java:230)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.renderContentAndDiff(DaisyHtmlDiffer.java:168)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.createOrGetFutureDiff(DaisyHtmlDiffer.java:145)
Diagnosis
Enable the following debug logging:
com.atlassian.confluence.diff
com.atlassian.confluence.pages.actions
See Configuring Logging for details on how to implement the debug logging.
Then, execute the page version comparison again. The following will appear in the atlassian-confluence.log
:
DEBUG [http-8428-7] [confluence.pages.actions.PageAwareInterceptor] intercept Set page on PageAware com.atlassian.confluence.pages.actions.DiffPagesByVersionAction: page: LEP_1.2 Lepingu lisamine v.82 (2392272)
DEBUG [http-8428-7] [confluence.pages.actions.AbstractDiffPagesAction] execute Error while generating diff: (page: LEP_1.2 Lepingu lisamine v.52 (2393793) vs page: LEP_1.2 Lepingu lisamine v.82 (2392272))
-- referer: http://localhost:8428/pages/viewpreviousversions.action?pageId=2392272 | url: /pages/diffpagesbyversion.action | userName: adminconf | action: diffpagesbyversion | page: 2392272
com.atlassian.confluence.diff.InterruptedDiffException: Diff timed out during daisydiff.
at com.atlassian.confluence.diff.DaisyHtmlDiffer.diff(DaisyHtmlDiffer.java:230)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.renderContentAndDiff(DaisyHtmlDiffer.java:166)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.createOrGetFutureDiff(DaisyHtmlDiffer.java:143)
at com.atlassian.confluence.diff.DaisyHtmlDiffer.diff(DaisyHtmlDiffer.java:95)
Cause
The comparison of page versions failed because the task exceeded the default timeout of 30 seconds. It can occur when comparing a page version with another page version that has huge difference in the content.
Resolution
Increase the page version comparison timeout value to a higher value (in milliseconds) using the following parameter and restart Confluence for the changes to take effect. For example, the parameter below increases the timeout to 60 seconds:
-Dconfluence.html.diff.timeout=60000
You can refer to Configuring System Properties for instructions on how to add the parameter above in your environment.
Note that page comparison is an expensive task. Therefore, be considerate in increasing the timeout as it might cause a performance issue.
Note
It's also possible that you will hit into a proxy timeout when comparing the page, so you will need to alter the timeout value in your reverse proxy.
If you're running NGINX in front of Confluence, the default request timeout value is 60 seconds. If you hit into the error above, you can apply the solution below and increase the timeout to 120 seconds. Take note that the solution will differ based on your reverse proxy.
proxy_read_timeout 120;
proxy_connect_timeout 120;
proxy_send_timeout 120;