Can't upgrade: CSRF attack warning, then error about major versions

Please help us by providing the following info. Before posting please also check the pinned "Known issues" threads and make sure that you're running the latest available version for your oC release: https://owncloud.org/changelog/

Steps to reproduce
1. Attempt to upgrade 8.0.3 to the next version
2. Follow all the instructions with my current version
3. When time comes to press the Upgrade button, get an error: "Possible CSRF attack. Connection will be closed."
4. Go to owncloud directory and enter sudo -u www-data php occ upgrade

The response is Exception: Updates between multiple major versions and downgrades are unsupported.

Expected behaviour
Well, I was hoping that as of step 3 above the upgrade would be completed with no errors.

Actual behaviour
The error listed above.

Server configuration
Operating system: Ubuntu 14.04 server
Web server: Apache 2.4.7
Database: MySQL
PHP version: 5.5.9
ownCloud version (see ownCloud admin page): 8.0.3
Updated from an older ownCloud or fresh install: This was a fresh install about a year ago
ownCloud log (data/owncloud.log, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808): It's 2661 lines long...but tail owncloud.log is given below.

I'm a bit stumped... how do I upgrade?

--
{"reqId":"5d803442bacb1e8033e038a1e372954a","remoteAddr":"118.209.102.196","app":"core","message":"Invalid OCS content returned for app 166053","level":4,"time":"2016-07-31T11:10:40+00:00"}
{"reqId":"5d803442bacb1e8033e038a1e372954a","remoteAddr":"118.209.102.196","app":"core","message":"Invalid OCS content returned for app 166051","level":4,"time":"2016-07-31T11:10:40+00:00"}
{"reqId":"5d803442bacb1e8033e038a1e372954a","remoteAddr":"118.209.102.196","app":"core","message":"Invalid OCS content returned for app 166056","level":4,"time":"2016-07-31T11:10:41+00:00"}
{"reqId":"5d803442bacb1e8033e038a1e372954a","remoteAddr":"118.209.102.196","app":"core","message":"Invalid OCS content returned for app 166049","level":4,"time":"2016-07-31T11:10:42+00:00"}
{"reqId":"5d803442bacb1e8033e038a1e372954a","remoteAddr":"118.209.102.196","app":"core","message":"Invalid OCS content returned for app 166052","level":4,"time":"2016-07-31T11:10:43+00:00"}
{"reqId":"Goli5vRelqF5PfBNvvY8","remoteAddr":"118.209.102.196","app":"index","message":"Exception: {\"Exception\":\"OC\\NeedsUpdateException\",\"Message\":\"\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/owncloud\\/lib\\/private\\/app.php(118): OC_App::loadApp('files')\n#1 \\/var\\/www\\/owncloud\\/lib\\/private\\/util.php(130): OC_App::loadApps(Array)\n#2 \\/var\\/www\\/owncloud\\/lib\\/base.php(850): OC_Util::setupFS()\n#3 \\/var\\/www\\/owncloud\\/index.php(39): OC::handleRequest()\n#4 {main}\",\"File\":\"\\/var\\/www\\/owncloud\\/lib\\/private\\/app.php\",\"Line\":139}","level":3,"time":"2016-07-31T11:19:03+00:00"}
{"reqId":"0He\/TgF\/7sd8Y9FPk7zc","remoteAddr":"","app":"core","message":"starting upgrade from 8.0.3.4 to 8.2.1.4","level":0,"time":"2016-07-31T11:25:46+00:00","method":"--","url":"--"}
{"reqId":"0He\/TgF\/7sd8Y9FPk7zc","remoteAddr":"","app":"core","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"Updates between multiple major versions and downgrades are unsupported.\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/owncloud\\/lib\\/private\\/updater.php(205): OC\\Updater->doUpgrade('8.2.1.4', '8.0.3.4')\n#1 \\/var\\/www\\/owncloud\\/core\\/command\\/upgrade.php(213): OC\\Updater->upgrade()\n#2 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Command\\/Command.php(253): OC\\Core\\Command\\Upgrade->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#3 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(874): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#4 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(195): Symfony\\Component\\Console\\Application->doRunCommand(Object(OC\\Core\\Command\\Upgrade), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#5 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(126): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#6 \\/var\\/www\\/owncloud\\/lib\\/private\\/console\\/application.php(97): Symfony\\Component\\Console\\Application->run(NULL, NULL)\n#7 \\/var\\/www\\/owncloud\\/console.php(69): OC\\Console\\Application->run()\n#8 \\/var\\/www\\/owncloud\\/occ(11): require_once('\\/var\\/www\\/ownclo...')\n#9 {main}\",\"File\":\"\\/var\\/www\\/owncloud\\/lib\\/private\\/updater.php\",\"Line\":285}","level":3,"time":"2016-07-31T11:25:46+00:00","method":"--","url":"--"}
{"reqId":"LTV4r30iT5Gz1ySHF2uD","remoteAddr":"","app":"core","message":"starting upgrade from 8.0.3.4 to 8.2.1.4","level":0,"time":"2016-07-31T11:28:06+00:00","method":"--","url":"--"}
{"reqId":"LTV4r30iT5Gz1ySHF2uD","remoteAddr":"","app":"core","message":"Exception: {\"Exception\":\"Exception\",\"Message\":\"Updates between multiple major versions and downgrades are unsupported.\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/owncloud\\/lib\\/private\\/updater.php(205): OC\\Updater->doUpgrade('8.2.1.4', '8.0.3.4')\n#1 \\/var\\/www\\/owncloud\\/core\\/command\\/upgrade.php(213): OC\\Updater->upgrade()\n#2 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Command\\/Command.php(253): OC\\Core\\Command\\Upgrade->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#3 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(874): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#4 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(195): Symfony\\Component\\Console\\Application->doRunCommand(Object(OC\\Core\\Command\\Upgrade), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#5 \\/var\\/www\\/owncloud\\/3rdparty\\/symfony\\/console\\/Symfony\\/Component\\/Console\\/Application.php(126): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#6 \\/var\\/www\\/owncloud\\/lib\\/private\\/console\\/application.php(97): Symfony\\Component\\Console\\Application->run(NULL, NULL)\n#7 \\/var\\/www\\/owncloud\\/console.php(69): OC\\Console\\Application->run()\n#8 \\/var\\/www\\/owncloud\\/occ(11): require_once('\\/var\\/www\\/ownclo...')\n#9 {main}\",\"File\":\"\\/var\\/www\\/owncloud\\/lib\\/private\\/updater.php\",\"Line\":285}","level":3,"time":"2016-07-31T11:28:06+00:00","method":"--","url":"--"}

Hi,

how did you do the upgrade and what was the next version you jumped to from the current 8.0.3?

Ok, found that info in your logfiles:

As referenced in the FAQ https://central.owncloud.org/t/updates-between-multiple-major-versions-are-unsupported/815 within your github post this is an unsupported upgrade as you have skipped one major version (8.1.x). A correct done upgrade would be:

8.0.3 -> 8.0.14 -> 8.1.9 -> 8.2.7

by following the steps provided in the FAQ above. The important part is that you delete all files and folders except /data/ and /config/ before extracting the new files of the next version you want to jump to.

Further reading is also available in the official documentation:

https://doc.owncloud.org/server/9.1/admin_manual/maintenance/upgrade.html

Thanks for that - well, I just followed the instructions in the admin part of my owncloud site, and I assumed that owncloud would choose the correct version to be upgraded to.

I'll try again...

I'm always suggesting to not use the updater app as it is broken since a longer time and showed various issues (especially between major upgrades) in the past. If you don't rely on the updater app and having access to the command line it is recommended to do the manual upgrade as described here:

https://doc.owncloud.org/server/9.1/admin_manual/maintenance/manual_upgrade.html

Thanks again! Well, I've gone to 8.0.14 with no troubles, so now I do the 8.1.9, 8.2.7, 9.0.4... route. However, every upgrade requires me to delete all of the previous upgrade (except for data and config) and repopulate the owncloud directory with the newer version. This seems a bit wasteful of time and bandwidth... would it be possible to upgrade with differences only, rather than the complete set of files?

If you make sure that no old files are left back then it would be possible. However i wouldn't risk this and do the suggested path above.

Once you are at 9.0.x then i think you can continue with using the updater app. This was rewritten there and shouldn't show that much issues (there are still a few left) as the old updater app in the 8.x releases.

Dammit - going up to 8.1.9 went fine, but the move to 8.2.7 gave me that dratted "Possible CSRF attack. Connection will be closed." error. I'll try upgrading from the terminal and see if that helps...

Sometime it helps to restart the webserver before running the upgrade routine but after copying the new code as it might be still some old files hiding somewhere in the cache.

The command sudo -u www-data php occ upgrade worked fine! Phew... this is turning out to be a bigger challenge than I thought.

As a side issue, why is it not possible to upgrade to a non-contiguous version? I imagine this would be like totally replacing the old version of owncloud with a new version, no matter what version number.

(And now I can't log in...)