hassio-addons: ❓ [Nextcloud] Can't start Nextcloud ... more than one major version behind

Nextcloud

Addon

Problem after updating I am having an issue after updating nextcloud:

I keep getting this error and have no idea how to incremental downgrade to fix the issue

Can't start Nextcloud because the version of the data (24.0.5.1) is more than one major version behind the docker image version (27.0.1.2) and upgrading more than one major version is not supported. Please run an image tagged for the major version 25 first.

Is there anyone here that can assist me with this? Nextcloud broke upon updating and I dont wanna lost any of my data from nextcloud

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll close this as the last element is a new issue already tracked here : https://github.com/alexbelgium/hassio-addons/issues/938

It is pinned if people have the same issue with the solution being just above : https://github.com/alexbelgium/hassio-addons/issues/928#issuecomment-1675846194

Your code worked, but

I upgraded everything and updated the addon and now i am getting this error: Can't start Nextcloud because the version of the data (27.0.2.1) is higher than the docker image version (27.0.1.2) and downgrading is not supported. Are you sure you have pulled the newest image version?

This looks bad

I understand, you have a super old version of the addon that does not include my auto updater 😉 Then let’s make the code by ourselves.

You need to create a file in /config/addons_autoscripts/ named nextcloud-ocr.sh

In this file, you could put the following code, then restart the addon:

#!/bin/bash
echo "Starting to work"
echo "*****************"

echo "... Clean potential errors"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ maintenance:repair" || true
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ maintenance:repair-share-owner" || true
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ maintenance:mode --off" || true

echo "... Launch initial update"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"

echo "... Install additional versions"
while [[ $(sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ update:check" 2>&1) == *"update available"* ]]; do
  echo "-----------------------------------------------------------------------"
  echo "  new version available, updating. Please do not turn off your addon!  "
  echo "-----------------------------------------------------------------------"
  sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
  sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
done
    
echo "... Checking for apps updates"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ app:update --all"

echo "Done, please reboot, removing file"
rm /config/addons_autoscripts/nextcloud-ocr.sh

Hi, only solution is to restore your backup and update manually through the admin panel. I had put a warning on the changelog but for auto updating systems it might be missed. It’s not due to the add-on but due to the upstream image so there is no workaround for this sorry

Is there any help you can give please? I’m super lost and dont quite know my way around docker stuff to well.