From 76dba1a5210c5e076d0b5da8969cd9b463600bfb Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Fri, 17 Jul 2015 11:29:28 +0000 Subject: [PATCH] the ownCloud upgrade must be run after apps are (re-)enabled after an upgrade --- setup/owncloud.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup/owncloud.sh b/setup/owncloud.sh index 8f15d03b..ad81693a 100755 --- a/setup/owncloud.sh +++ b/setup/owncloud.sh @@ -31,6 +31,7 @@ if [ ! -f $STORAGE_ROOT/owncloud/config.php ] \ fi # Check if ownCloud dir exist, and check if version matches owncloud_ver (if either doesn't - install/upgrade) +DID_OWNCLOUD_UPGRADE=0 if [ ! -d /usr/local/lib/owncloud/ ] \ || ! grep -q $owncloud_ver /usr/local/lib/owncloud/version.php; then @@ -66,8 +67,9 @@ if [ ! -d /usr/local/lib/owncloud/ ] \ # that error. chown -f -R www-data.www-data $STORAGE_ROOT/owncloud /usr/local/lib/owncloud - # Run the upgrade script (if ownCloud is already up-to-date it wont matter). + # Run the upgrade script. hide_output sudo -u www-data php /usr/local/lib/owncloud/occ upgrade + DID_OWNCLOUD_UPGRADE=1 fi # ### Configuring ownCloud @@ -156,6 +158,13 @@ hide_output sudo -u www-data php /usr/local/lib/owncloud/console.php app:enable hide_output sudo -u www-data php /usr/local/lib/owncloud/console.php app:enable contacts hide_output sudo -u www-data php /usr/local/lib/owncloud/console.php app:enable calendar +if [ $DID_OWNCLOUD_UPGRADE -gt 0 ]; then + # When upgrading, run the upgrade script again now that apps are enabled. It seems like + # the first upgrade at the top won't work because apps may be disabled during upgrade? + # This command will fail if there's nothing to upgrade. + hide_output sudo -u www-data php /usr/local/lib/owncloud/occ upgrade +fi + # Set PHP FPM values to support large file uploads # (semicolon is the comment character in this file, hashes produce deprecation warnings) tools/editconf.py /etc/php5/fpm/php.ini -c ';' \