Fail to upload XAR file for migration

I have XARs created by a legacy v8.0 xwiki that will not upload into either the same v8.0 xwiki (stack trace below) or v10.9 (no log output).

Hi there,

I have inherited a legacy xwiki, v8.0 (and using LDAP for users/authors), and I’m trying to migrate it across to a new setup. I’m unfamiliar with xwiki on the backend, and not particularly familiar with tomcat apps.

The problem I have is that when I create a XAR export file, I can’t upload it to either the new (test) server or the legacy server it was made on. I get a red “An error occurred while uploading NAME.xar” message at the bottom in both cases. The XAR file is 8MB without history or 15MB with history. I’ve also tried with/without “backup/author-preserved”

The new version did have a logline complaining about filesize, so I increased max cache size to 200MB and max object cache size to 20MB in context.xml - no more logline complaining about ‘too big for cache’. However, it’s still failing with the same generic red message, and there’s zero logs that I can find about the failure now.

The new setup is:

  • v10.9
  • on a 2GB test VM, but set to max java mem 1024MB (from docs, just for testing)
  • dedicated debian 9 VM
  • openjdk8
  • installed using deb packages
    ** xwiki-common
    ** xwiki-pgsql-common
    ** xwiki-tomcat8-common
    ** xwiki-tomcat8-pgsql
  • not set up with LDAP yet

The legacy version:

  • v8.0
  • been running untouched for years, on ubuntu 14.04
  • don’t know how it was installed, but it’s sitting in /opt
  • has a couple of ‘simple’ users, and the rest are LDAP

The legacy version (v8.0), when I upload the XAR file that it itself made, gives me the following trace in the logs - I don’t know how to interpret this, but it doesn’t seem like it’s related to file size:

2018-11-09 12:41:41,043 [] WARN  c.x.x.w.UploadAction           - Saving uploaded file failed 
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document xwiki:XWiki.XWikiPreferences
	at com.xpn.xwiki.XWiki.saveDocument(
	at com.xpn.xwiki.XWiki.saveDocument(
	at com.xpn.xwiki.web.UploadAction.uploadAttachment(
	at com.xpn.xwiki.web.UploadAction.action(
	at com.xpn.xwiki.web.XWikiAction.execute(
	at com.xpn.xwiki.web.XWikiAction.execute(
	at org.apache.struts.action.RequestProcessor.processActionPerform(
	at org.apache.struts.action.RequestProcessor.process(
	at org.apache.struts.action.ActionServlet.process(
	at org.apache.struts.action.ActionServlet.doPost(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.jetty.servlet.ServletHolder.handle(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at com.xpn.xwiki.web.ActionFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.xwiki.resource.servlet.RoutingFilter.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.servlet.ServletHandler.doScope(
	at org.eclipse.jetty.server.session.SessionHandler.doScope(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handle(
	at org.eclipse.jetty.server.HttpChannel.handle(
	at org.eclipse.jetty.server.HttpConnection.onFillable(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$
Caused by: com.xpn.xwiki.XWikiException: Error number 3211 in 3: Exception while updating archive XWiki.XWikiPreferences
	... 47 common frames omitted
Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
	at com.xpn.xwiki.doc.rcs.XWikiRCSNodeInfo.getContent(
	at com.xpn.xwiki.doc.XWikiDocumentArchive.makePatch(
	at com.xpn.xwiki.doc.XWikiDocumentArchive.updateArchive(
	... 48 common frames omitted
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent#com.xpn.xwiki.doc.rcs.XWikiRCSNodeId@3e982458[docId=6152552094868048244,version=35.1]]
	at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(
	at org.hibernate.event.def.DefaultLoadEventListener.load(
	at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(
	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(
	at org.hibernate.impl.SessionImpl.fireLoad(
	at org.hibernate.impl.SessionImpl.load(
	... 54 common frames omitted

So… I’m not sure what’s going on here. I would prefer to change to the psql from mysql, which is why I’m trying the export/import migration path. I suppose I could stick with mysql and try that method of migration



The error indeed does not seems to have anything to do with the size of the attachment. It’s failing while saving the history of the page which contain the attachment you are trying to upload and suggest that the history if that page is broken for some reason (it actually load the history, modify it and then save it and it fail to load it).

Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xpn.xwiki.doc.rcs.XWikiRCSNodeContent#com.xpn.xwiki.doc.rcs.XWikiRCSNodeId@3e982458[docId=6152552094868048244,version=35.1]]

According to this line there is an inconsistency in the DB and one entry on the table xwikircs (which contains the version of a document) lost its corresponding xwikirecyclebin entry (which contain the actual patch). The entry seems to be the one with document id 6152552094868048244 and version 35.1. Not really sure what is the best to fix this inconsistency, you might want to try to backup the database and remove that broken xwikircs entry (you might need to restarted if the history is still in the cache) and see if it fix the issue (hoping there is no other like this one).

Thanks for the info, Thomas, I’m back on this in the next couple of days. I’d never have figured that out myself. I’ll try it out shortly.

Okay, thanks Thomas, your suggestion helped. There were actually a few problems happening all at once. The problem on the new server was because I hadn’t opened up the payload size (client_max_body_size) on my nginx reverse proxy. This would be why I wasn’t getting logs of the error on the v10.9 wiki, because it was faulting at the reverse proxy.

Your suggestion re: that database line definitely helped - checking it out, it was related to the previous admin’s import package. Took a db backup, deleted the bad historical package, and did a new export, and now I have an export file that uploads successfully on both v8 and v10 wikis. Unfortunately on the old v8 wiki, I can’t now delete that new import package :slight_smile:

Over on a fresh install of the 10.9 wiki with the nginx chokepoint + tomcat chokepoints opened up, I was now able to upload the new working export package successfully. Now I have extra fun: due to the LDAP setup, neither the admin user created by the initial setup wizard, or the superadmin user can do anything - everything is blocked. None of the LDAP users have admin rights anyway; the old wiki export was done with the superadmin. So now I have a wiki that I have no user to manage with :slight_smile: However, that’s a new, different problem out of scope of my initial question.

Thanks again for the help!