Summary: when trying to import a XAR file, I get a 400: Unable to parse form content error in the log.
Steps:
I downloaded the xwiki-platform-distribution-flavor-jetty-hsqldb-11.9 zip file.
Then changed the webapps\xwiki\WEB-INF\hibernate.cfg.xml file to point to MySQL.
Created the database and added permissions.
Started the wiki, created the admin user and installed the standard flavor.
Administer Wiki => Content => Export => generated a 127MB file.
Tried to import it and get the error.
I don’t get a stack trace, but only this in the request log:
0:0:0:0:0:0:0:1 - - [20/Nov/2019:07:20:43 +0000] “POST /xwiki/bin/get/XWiki/XWikiPreferences?xpage=packagedescriptor&package=xwikiBackup.xar HTTP/1.1” 200 464343
0:0:0:0:0:0:0:1 - - [20/Nov/2019:07:20:46 +0000] “GET /xwiki/webjars/wiki%3Axwiki/xwiki-platform-tree-webjar/11.9/tree.min.css?evaluate=true HTTP/1.1” 200 31686
0:0:0:0:0:0:0:1 - - [20/Nov/2019:07:20:54 +0000] “POST /xwiki/bin/import/XWiki/XWikiPreferences?editor=globaladmin§ion=Import HTTP/1.1” 400 10130
Tried that and still doesn’t work and yes, I did restart after each try.
I am just wondering how this setting could have any impact. The backup file is already uploaded so it should already be on the server. It’s when clicking the Import button that I get the 400 error.
The problem is not about the upload of the file, but of the pages you want to import. If I’m correct, you should have a list of pages to import in the UI, and basically when you chose to import all of them it creates a very big HTTP query with all the fields. It’s something we should fix in the future.
Now in your case, maybe there’s just again too many pages and 1000000 is not a value big enough.
As I mentioned in the first post, it’s a 127MB file. So I set it to 200MB.
Anyway, I was just testing out the export/import feature as a quick way to upgrade.
I guess I’ll use the DB backup approach instead. There seems to be auto db upgrades available.
So actually the issue is not related to maxFormContentSize but to maxFormKeys: it appears that the default value is limited to 1000 forms keys, which won’t be enough if you have more than 1000 pages. And by default XWiki 11.10 already have 1057 pages. You should be able to fix your problem by setting a new configuration in jetty.xml with a value of 2000 for maxFormKeys.