Page edit fails with an error about snapshot size
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Summary
Editing certain pages fails, and the user is redirected to BASEURL/pages/viewpage.action?pageId=XXXXX&editingFailed. The following message may appear on screen:
Environment
Confluence 7.4.5 (may also occur in other versions)
Diagnosis
Check Synchrony logs (atlassian-synchrony.log) for an error like the following:
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler 2020-11-19 18:14:00,351 WARN [async-dispatch-8] [synchrony.sync.hubs] snapshot exceeds maximum size {:entity "/Synchrony-1a6fdedc-a84b-3a2f-ab5e-f1fb10545088/confluence-123456789", :max-snapshot-size 16777216, :actual-size 17245504, :throwable #error {
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :cause "snapshot exceeds maximum size"
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :data {:message "snapshot exceeds maximum size", :max-snapshot-size 16777216, :actual-size 17245504}
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :via
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler [{:type clojure.lang.ExceptionInfo
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :message "snapshot exceeds maximum size"
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :data {:message "snapshot exceeds maximum size", :max-snapshot-size 16777216, :actual-size 17245504}
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :at [ginga.core$throwable invokeStatic "core.cljc" 331]}]
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler :trace
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler [[ginga.core$throwable invokeStatic "core.cljc" 331]
2020-11-19 18:14:00,351 DEBUG [439:StdOutHandler [ginga.core$throw_map invokeStatic "core.cljc" 336]
Cause
The snapshot of the page exceeds the limit set by the system. During an editing session, Confluence stores the recent state of the document being edited by creating a snapshot of it, and then uses events that come after to reconstruct the state during the editing session. There's a constant called max-snapshot-size that acts as a guardrail to prevent a really large page, which can't be edited anyway, from consuming all of the memory allocated to Synchrony during the snapshot creation phase. When such a page is edited, Synchrony will throw a "snapshot exceeds maximum size" error and editing will fail.
The constant is set to 16MB and cannot be modified.
Solution
Split the large page into smaller pages.