There is 1 update, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-704af665-7be9-4514-b2d6-517c5093b710 XWIKI-6161 Open

Reset action does not work anymore

 
View issue   ·   Add comment
 

1 update

 
cid:jira-generated-image-avatar-dd069061-6330-477d-a319-f3035bf758d3 Changes by Vincent Massol on 17/Sep/26 18:00
 
Summary: Reset Action doesn't action does not work anymore on page without history
 
 

1 comment

 
cid:jira-generated-image-avatar-dd069061-6330-477d-a319-f3035bf758d3 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 error.png HTTP 500
New page, several versions ResetTest.MultiB 3.1, 2.1, 1.1 error.png HTTP 500
Bundled XS page, untouched Sandbox.WebHome 1.1 error.png HTTP 500
Bundled XS page, edited Sandbox.TestPage1 2.1, 1.1 error.png HTTP 500
Edited home page Main.WebHome 2.1, 1.1 error.png 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.resetArchiveresetRCSArchive 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.