Problem with Nextcloud after upgrade

NethServer Version: 7.7.1908
Hi
Not sure what have happend with my nextcloud but I get his error when I tryint to access from the webinterface

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

And the log show alot like this
https://pastebin.com/ksqeBJ3a

Not sure what to do.
At first I was thinking it maybe was my MySQL but my MySQL server I can’t see anything that is connected to Nextcloud and in the Nethserver applications I can’t see MySQL and I do not remember how I did install nextcloud.

1 Like

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_filecache_extended’ doesn’t exist"

I think there was a problem when upgrading Nextcloud and at least a migration script was unsuccessful.

Which Nextcloud version do you have?

rpm -q nethserver-nextcloud nextcloud

Can you search logs or yum history to find out what version you had and the version you upgraded to? Maybe you upgraded Nextcloud skipping some major version (like version 17).

What’s the outcome of this command?

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:status core

Check if the following command shows some error:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ upgrade

Thanks for the replay

rpm -q nethserver-nextcloud nextcloud
give me

nethserver-nextcloud-1.8.5-1.ns7.noarch
nextcloud-18.0.0-1.el7.noarch

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:status core
give me

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
>> App: core
>> Version Table Name: oc_migrations
>> Migrations Namespace: OC\Core\Migrations
>> Migrations Directory: /usr/share/nextcloud/core/Migrations
>> Previous Version: 16000Date20190427105638
>> Current Version: 16000Date20190428150708
>> Next Version: 17000Date20190514105811
>> Latest Version: 18000Date20191204114856
>> Executed Migrations: 20
>> Executed Unavailable Migrations: 20
>> Available Migrations: 24
>> New Migrations: 24
>> Pending Migrations: None

`sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ upgrade`

gave me

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

Looks like something error with the upgrade?

The problem is that Nextcloud doesn’t like upgrading skipping major versions (for example, like in your case, upgrading from 16.x to 18.x, skipping 17.x). One possible solution could be to downgrade \*nextcloud packages from 18.x to 17.x , then upgrade from 17.x to 18.x . Check the process described in the wiki.

Another solution could be to manually execute the previous migration scripts, but haven’t tested if it works, so if you try have a backup at least of the database an tell us if it worked:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 17000Date20190514105811

If it stills fails after executing that migration, maybe other migrations steps shall be ran. I think you can tell that by running again the core status command and looking at the Next Version line, which might describe the next migration step to run. I believe the next steps would be:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 18000Date20190920085628
sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 18000Date20191014105105

Well I did trying the first one and it set me in maintenance mode and after I turn it off I get “Updates between multiple major versions are unsupported”.

So I think is easy for me is to reinstall a new nethserver and new nextcloud.

Whatever you feel more comfortable with to make it work is fine.

To keep it short, in your case the previous post would resume into either one of these options.
Option 1 (described in the wiki):

yum downgrade nethserver-nextcloud-1.8.4-1.ns7 nextcloud-17.0.2-1.el7
yum update nethserver-nextcloud nextcloud

or Option 2 (untested):

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 17000Date20190514105811
sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 18000Date20190920085628
sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core 18000Date20191014105105
3 Likes

Wow nice it did works for me :slight_smile:
Have to take it easy next time I do a update with nethserver (or maybe run update alot more lol)

Just out of curiosity tested option 2. Apparently worked in this way but cannot recommend it as I’m unsure if there’s any step missing using this method and it is supposed to be used for development and debugging purposes:

While Next Version was different from Already at latest migration step, got next version:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:status core

…and executed migration specifying the value of next version:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ migrations:execute core nextversiongoeshere

…till there was no more new version available.

Then manually edited nextcloud config.php file faking the Version number to the next major release (i.e., if you had 16.x.x.x, use 17.0.0.0).
Then executed occ upgrade command:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M /usr/share/nextcloud/occ upgrade

Info on occ migrations commands.

Moreover, after updating some apps and checking nextcloud log, it was flooded with Deprecated event type for OCA\User_LDAP\User\User::postLDAPBackendAdded: null. This Info message flooding the logs is probably unrelated to the upgrade method:



Maybe fixed in:

Wow Marc, you rocks! :smiley:

Applying update once a month should be enough :wink:

Didn’t work for me… As I still have few users, is it possible to completely delete the package and install version 18? Do I have to drop nextcloud database after deleting the package?

TIA,


seb

If you want to troubleshoot it you can open a new topic with the problem and errors Nextcloud is reporting. Otherwise, to remove nextcloud (including user data) check https://docs.nethserver.org/projects/nethserver-devel/en/latest/nethserver-nextcloud.html#full-reinstall

Hi @dnutan

Il felt (again) into the nextcloud upgrade trap. That update case should be handled IMHO.

Anyway, I tried the above downgrade commande but yum doesn’t agree :

# yum downgrade nethserver-nextcloud-1.8.4-1.ns7 nextcloud-17.0.2-1.el7
Loaded plugins: changelog, fastestmirror, nethserver_events
Loading mirror speeds from cached hostfile
 * ce-base: mirror.mhd.uk.as44574.net
 * ce-extras: mirror.mhd.uk.as44574.net
 * ce-sclo-rh: mirror.mhd.uk.as44574.net
 * ce-sclo-sclo: mirror.mhd.uk.as44574.net
 * ce-updates: mirror.mhd.uk.as44574.net
 * epel: mirror.init7.net
 * nethforge: mirror.alpix.eu
 * nethserver-base: mirror.alpix.eu
 * nethserver-updates: mirror.alpix.eu
No Match for available package: nextcloud-17.0.2-1.el7.noarch
Resolving Dependencies
--> Running transaction check
---> Package nethserver-nextcloud.noarch 0:1.8.4-1.ns7 will be a downgrade
--> Processing Dependency: nextcloud >= 17.0.2 for package: nethserver-nextcloud-1.8.4-1.ns7.noarch
Package nextcloud-18.0.0-1.el7.noarch is obsoleted by nethserver-nextcloud-1.9.0-1.ns7.noarch which is already installed
---> Package nethserver-nextcloud.noarch 0:1.9.0-1.ns7 will be erased
--> Finished Dependency Resolution
Error: Package: nethserver-nextcloud-1.8.4-1.ns7.noarch (nethserver-updates)
           Requires: nextcloud >= 17.0.2
           Removing: nethserver-nextcloud-1.9.0-1.ns7.noarch (@nethserver-updates)
               nextcloud
           Downgraded By: nethserver-nextcloud-1.8.4-1.ns7.noarch (nethserver-updates)
               Not found
           Available: nextcloud-10.0.4-2.el7.noarch (epel)
               nextcloud = 10.0.4-2.el7
           Available: nextcloud-16.0.4-1.el7.noarch (nethserver-base)
               nextcloud = 16.0.4-1.el7
           Available: nextcloud-16.0.5-1.ns7.noarch (nethserver-updates)
               nextcloud = 16.0.5-1.ns7
           Available: nextcloud-17.0.1-1.el7.noarch (nethserver-updates)
               nextcloud = 17.0.1-1.el7
           Available: nextcloud-17.0.2-1.el7.noarch (nethserver-updates)
               nextcloud = 17.0.2-1.el7
           Available: nextcloud-18.0.0-1.el7.noarch (nethserver-updates)
               nextcloud = 18.0.0-1.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

I don’t understand, what should I do ?

txs

try it again. If it does not work, clear yum cache and give it another go.

Didn’t work.

I think it is because older nextcloud packages were obsoleted by nethserver-nextcloud-1.9.0-1.ns7.

I had to remove nethserver-nextcloud and nextcloud packages, then

yum --setopt=obsoletes=0 install nextcloud-17.0.2-1.el7 
yum --setopt=obsoletes=0 install nethserver-nextcloud-1.8.4-1.ns7  

then update.

Phew. @davidep I really believe that the case should be handled. At minima warning the user that something is going to go wrong.