From 841181ed55619e1a04eda5c0d1b29cb2bf87a055 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 23 Aug 2015 12:37:25 -0400 Subject: [PATCH] ownCloud 8.1.1 broke upgrades: do "occ upgrade" twice Per https://github.com/owncloud/core/issues/18224 and https://discourse.mailinabox.email/t/v13-upgrade-issue-with-calendar/757/10, upgrades from anything to ownCloud 8.1.1 were broken. But the workaround is to run the upgrade step twice. --- setup/owncloud.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup/owncloud.sh b/setup/owncloud.sh index 28665813..4cd8c970 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -70,8 +70,16 @@ if [ ! -d /usr/local/lib/owncloud/ ] \ # If this isn't a new installation, immediately run the upgrade script. # Then check for success (0=ok and 3=no upgrade needed, both are success). if [ -f $STORAGE_ROOT/owncloud/owncloud.db ]; then + # ownCloud 8.1.1 broke upgrades. It may fail on the first attempt, but + # that can be OK. sudo -u www-data php /usr/local/lib/owncloud/occ upgrade - if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi + if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then + echo "Trying ownCloud upgrade again to work around ownCloud upgrade bug..." + sudo -u www-data php /usr/local/lib/owncloud/occ upgrade + if [ \( $? -ne 0 \) -a \( $? -ne 3 \) ]; then exit 1; fi + sudo -u www-data php /usr/local/lib/owncloud/occ maintenance:mode --off + echo "...which seemed to work." + fi fi fi