Reset Action doesn't action does not work anymore on page without history
1 comment
Vincent Massol on 17/Sep/26 18:00
I've retested this on XWiki 18.7.0 and the reset action fails in every case — the "page without history" restriction in this issue's summary no longer holds.
Method: logged in as a user with admin rights, then issued the exact request the confirmation form sends, GET /xwiki/bin/reset/<Space>/<Page>?confirm=1&form_token=<token>, reading the document history over REST before and after each call.
Case
Document
History before
Result
New page, no history (1.1 only)
ResetTest.SingleA
1.1
HTTP 500
New page, several versions
ResetTest.MultiB
3.1, 2.1, 1.1
HTTP 500
Bundled XS page, untouched
Sandbox.WebHome
1.1
HTTP 500
Bundled XS page, edited
Sandbox.TestPage1
2.1, 1.1
HTTP 500
Edited home page
Main.WebHome
2.1, 1.1
HTTP 500
In all five cases the history is left untouched afterwards, so the failure is total rather than a partial reset.
All five fail with the same root cause (stack condensed to the relevant frames):
Error number 3211 in 3: Exception while updating archive <doc>
at com.xpn.xwiki.store.XWikiHibernateVersioningStore.updateXWikiDocArchive(XWikiHibernateVersioningStore.java:278)
at com.xpn.xwiki.store.XWikiHibernateVersioningStore.resetRCSArchive(XWikiHibernateVersioningStore.java:247)
at com.xpn.xwiki.doc.XWikiDocument.resetArchive(XWikiDocument.java:7923)
at com.xpn.xwiki.web.ResetVersionsAction.action(ResetVersionsAction.java:54)
Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
at com.xpn.xwiki.store.XWikiHibernateVersioningStore.saveXWikiDocArchive(XWikiHibernateVersioningStore.java:179)
Caused by: org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo#com.xpn.xwiki.doc.rcs.XWikiRCSNodeId@7077016a[docId=-276642650027448639,version=1.1,wikiReference=Wiki xwiki]]
Two statements recorded on this issue are no longer true:
The narrowing in Thomas Mortagne's 2013-09-12 comment ("untouched standard XE page", explicitly not reproducible on an edited home page) — the edited home page now fails too, see the last row above.
"Calling the action a second time works though" — it does not. Three consecutive reset calls on the same document fail identically, verified on the first three documents of the table.
Since the "with history / without history" distinction has disappeared, XWIKI-21277 describes exactly the same defect and I'm closing it as a duplicate of this one. I'm also updating this issue's summary to drop the "on page without history" restriction.
Carrying over the useful note from XWIKI-21277: the same XWikiDocument.resetArchive → resetRCSArchive path is also reached from the public API (Document.getDoc().resetArchive(...)) and from the old importer's "reset history" option (Package.java#L927), so those two call sites are presumably affected in the same way — that was not verified in this retest.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.