I was trying to update my nextcloud today. It is running on a hosted webspace, not on my own web server. I have ssh access to it so I was doing the upgrade like this.
ooc upgrade
was telling me that I already had the latest update. So I thought that ooc is not doing major version updates.
Going to /updater and running php updater.phar
was then upgrading to 31.0.5 after some issues with old backups in the updater directory it was running through fine.
However afterwards the DB update failed at the end telling me the following.
Exception: Database error when running migration 31000Date20240821142813 for app files_sharing An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘db36233.s.attributes’ in ‘CHECK’
files_sharing seems to be one of the main apps. I’m not really into databases that much. Is there some additional command I can run to add the column that is not found?
Well thanks, but as I mentioned the DB update was failing, so the Nextcloud wasn’t working. I was only able to access it with ssh.
Anyway I tried several of the occ maintenance commands and also the occ upgrade command and after some time it completed the update. I don’t know what really fixed the issue but at the moment it seems to be working again.
Maybe it was also a server problem that got fixed while I was at it. Not really sure.
What specific version of v30 did you upgrade from?
Also, can you provide some historical context about your installation? Has it been around for a while (i.e. through various major version upgrades such as thru/starting around ~v25)? Was it an Owncloud migration originally? etc.
It was from the latest 30.0.x I think .11 but occ upgrade said I already have the latest version.
In general I’m working with the web updater. But if that has a problem I go through the effort with the ssh connection. So my update started with 30.0.8 or 9 I think. The web updater then installed .11 just fine. But when trying to update to 31.0.5 it ran into problems. That’s when I connected with ssh and started the process above.
As a wider context it is a quite old installation. I started using it when there was only Owncloud but back then I only used it as a Dropbox replacement so whenever there was an update or something and I ran into problems I just reinstalled the whole thing and synced my files back onto it. So I’m pretty sure the last installation from scratch was already a Nextcloud. But probably one of the earlier versions, yes.
For the moment it is running again and I don’t seem to have issues.
I have the same problem. For me, it is also an old owncloud installation which has been updated for years.
Exception: Database error when running migration 31000Date20240821142813 for app files_sharing An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column '`dbxxxx`.`s`.`attributes`' in 'CHECK'
I couldn’t fix it for now. Any ideas if there is a fix, e.g. by changing something in the database?
I tried upgrading from 30.0.11 to 31.0.5. The upgrade basically worked but afterwards owncloud reported errors that point to a missing update in the database scheme. I performed the upgrade via:
sudo -u www-data php /var/www/owncloud/updater/updater.phar @kawa did you upgrade on a similar way and then in another step upgraded the database scheme via occ upgrade?
Thanks
Rainer
P.S When I talked about owncloud I actually ment Nextcloud. My installation started quite a while ago with an Owncloud before I switched to Nextcloud some years ago.
The errors I see after the upgrade are things like this:
An exception occured while running the setup check: PDOException: SQLSTATE[42S02]: Base table or view not found
: 1146 Table 'owncloud.oc_bruteforce_attempts' doesn't exist in /var/www/owncloud/3rdparty/doctrine/dbal/src/Driver
/PDO/Statement.php:130 Stack trace: #0 /var/www/owncloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(130):
PDOStatement->execute() #1 /var/www/owncloud/3rdparty/doctrine/dbal/src/Connection.php(1104): Doctrine\DBAL\Driver\
PDO\Statement->execute() #2 /var/www/owncloud/lib/private/DB/Connection.php(419): Doctrine\DBAL\Connection->execute
Query() #3 /var/www/owncloud/lib/private/DB/ConnectionAdapter.php(50): OC\DB\Connection->executeQuery()
I used the Web based updater from the nextcloud installation which worked well before.
Now the first part succeeded but the database update produced the error. This then succeeded via ssh.
But still there is something wrong in the database. The check for the share table has some problem but I didn’t have time to investigate it further.
For now it is not causing any problems. So, I can use it without problems at the moment.
Hello,
I had the same problem when upgrading from 30.0.11 to 31.0.5 when using web based updater but also with occ upgrade.
For me it turned out to be a problem with a strange bug in MariaDB 10.5.10. Updating MariaDB to a current version fixed the problem for me. Simply restarting mysql server could already solve the problem as well.
Good luck!