Missing Field in Table oc_dav_shares

Hey,

when trying to check my calendars it doesn’t show and it’s getting stuck with the loading icon.
I’m getting the following error in logs:
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT publicuri FROM oc_dav_shares WHERE (resourceid = ?) AND (access = ?)’ with params [“1”, 4]: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘publicuri’ in ‘field list’

That column doesn’t exist as some others are missing regarding database.xml

There had been some issues while upgrading but I really need my calendars and don’t know what the perfect solution is.
Setting up a new installation probably won’t solve my problems while still giving me access to my calendars. Is it possible to get access to the upgrade routines that obviously didn’t work in the past?

Is it possible to repair by hand?

Nextcloud version (eg, 10.0.2): 11
Operating system and version (eg, Ubuntu 16.04): Debian 8.7

The output of your Nextcloud log in Admin > Logging:
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT publicuri FROM oc_dav_shares WHERE (resourceid = ?) AND (access = ?)’ with params [“1”, 4]: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘publicuri’ in ‘field list’

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php $CONFIG = array ( 'instanceid' => 'XXX', 'passwordsalt' => 'XXX', 'datadirectory' => 'XXX/data', 'dbtype' => 'mysql', 'version' => '11.0.2.7', 'dbname' => 'cloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'cloud', 'dbpassword' => 'XXX', 'installed' => true, 'forcessl' => true, 'maintenance' => false, 'theme' => '', 'maxZipInputSize' => 3145728000, 'allowZipDownload' => true, 'loglevel' => 0, 'secret' => 'XXX', 'trusted_domains' => array ( 0 => 'XXX', ), 'data-fingerprint' => 'XXX', 'mail_from_address' => 'XXX', 'mail_smtpmode' => 'php', 'mail_domain' => 'XXX', 'updater.secret' => 'XXX', ); Thanks very much in advance!

What upgrade caused the issue? If it is the upgrade to NC 11, you can just run the upgrade command from your terminal and it should update the database:

sudo -u www-data php /var/www/nextcloud/occ upgrade

Output:
sudo -u www-data php occ upgrade
Nextcloud is already latest version

I did some nasty upgrades in the past… The calenders did work with ownloud 9.1.2 two hours ago and after upgrading to NC 10 + NC 11 it didn’t work anymore. I also deinstalled the old calender plugins and activated the new ones because the installer said it had some problems with dav…

There were some major changes in OC 9.0, old data were then deleted with OC 9.1. But once you have set up everything properly on OC 9.1, it shouldn’t break then. I suppose you did proper upgrades to NC 10 and NC 11.

Did you try the occ-repair command? It is supposed to clean up the database:
sudo -u www-data php /var/www/nextcloud/occ maintenance:repair

Yes, no help :frowning:

root@web:/var/www/XXX# sudo -u www-data php occ maintenance:repair

  • Repair MySQL collation
  • Repair mime types
  • Repair legacy storages
  • Remove asset cache
    • Asset cache cleared.
  • Generate ETags for file where no ETag is present.
    • ETags have been fixed for 0 files/folders.
  • Clean tags and favorites
    • 0 tags of deleted users have been removed.
    • 0 tags for delete files have been removed.
    • 0 tag entries for deleted tags have been removed.
    • 0 tags with no entries have been removed.
  • Drop old database tables
    31/31 [============================] 100%
  • Drop old background jobs
  • Remove getetag entries in properties table
    • Removed 0 unneeded “{DAV:}getetag” entries from properties table.
  • Repair outdated OCS IDs
  • Repair invalid shares
  • Remove old share propagation app entries
  • Remove old (< 9.0) calendar/contact shares
    4/4 [============================] 100%
  • Fix permissions so avatars can be stored again
    2/2 [============================] 100%
  • Remove shares of a users root folder
  • Repair unmerged shares
  • Move .step file of updater to backup location
  • Add move avatar background job
    • Repair step already executed
  • Add preview cleanup background jobs
  • Fix potential broken mount points
    • No mounts updated
  • Fix component of birthday calendars
    • 2 birthday calendars updated.
  • Insert ValueFix background job for each user