NotPermittedException after upgrade from RC 27.1.4 to RC 28.0.2

Hi!

Nextcloud version: 28.0.2
Operating system and version: Ubuntu 22.04 LTS
Apache or nginx version: Apache2 2.4.52
PHP version : 8.1.2-1ubuntu2.14

Since the upgrade from NC 27.1.4 to 28.0.2, I am regularly seeing these errors in the log:

NotPermittedException
Error while running background job (class: OCA\Files_Versions\BackgroundJob\ExpireVersions, arguments: )
Error while running background job (class: OCA\Files_Versions\BackgroundJob\ExpireVersions, arguments: )

Full log version:

{"reqId":"n3c9HSGXwyKAljfPiIuY","level":3,"time":"2024-02-14T23:20:01+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )","userAgent":"--","version":"28.0.2.5","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"","Code":0,"Trace":[{"file":"/var/www/owncloud/apps/files_versions/lib/Storage.php","line":624,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/owncloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":69,"function":"expireOlderThanMaxForUser","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/owncloud/lib/private/User/Manager.php","line":656,"function":"OCA\\Files_Versions\\BackgroundJob\\{closure}","class":"OCA\\Files_Versions\\BackgroundJob\\ExpireVersions","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/owncloud/apps/files_versions/lib/BackgroundJob/ExpireVersions.php","line":70,"function":"callForSeenUsers","class":"OC\\User\\Manager","type":"->"},{"file":"/var/www/owncloud/lib/public/BackgroundJob/Job.php","line":81,"function":"run","class":"OCA\\Files_Versions\\BackgroundJob\\ExpireVersions","type":"->"},{"file":"/var/www/owncloud/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/owncloud/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/owncloud/cron.php","line":152,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/owncloud/lib/private/Files/Node/File.php","Line":138,"message":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )","exception":{},"CustomMessage":"Error while running background job (class: OCA\\Files_Versions\\BackgroundJob\\ExpireVersions, arguments: )"}}

Is this the first time you’ve seen this error? :Y

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' => '/var/www/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.2.5',
  'dbname' => 'owncloud',
  'dbhost' => 'db.example.com',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'user',
  'dbpassword' => 'password',
  'installed' => true,
  'loglevel' => '1',
  'log_rotate_size' => 10485760,
  'theme' => '',
  'maintenance' => false,
  'trusted_domains' => 
  array (
    0 => 'www.example.com',
    1 => '192.168.1.103',
    2 => 'web.example.com',
    3 => '192.168.1.114',
  ),
  'share_folder' => '/Shared',
  'mail_domain' => 'example.com',
  'mail_from_address' => 'noreply',
  'mail_smtpdebug' => false,
  'mail_smtpmode' => 'smtp',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'logtimezone' => 'Europe/Berlin',
  'overwrite.cli.url' => 'https://www.example.com/owncloud',
  'secret' => 'xxx',
  'trashbin_retention_obligation' => 'auto',
  'updatechecker' => false,
  'updater.server.url' => 'https://updates.nextcloud.org/server/',
  'updater.release.channel' => 'stable',
  'htaccess.RewriteBase' => '/owncloud',
  'versions_retention_obligation' => 'auto, 90',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.example.com',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'noreply@example.com',
  'mail_smtppassword' => 'password',
  'mysql.utf8mb4' => true,
  'default_phone_region' => 'DE',
  'maintenance_window_start' => 4,
);

Anything I need to do about this? Or should I just ignore it…?

Thanks!

  • Do you / any of your users have External Storage mounts that might be offline?
  • Also, anything change permission-wise with /var/www/owncloud/data during your update (i.e. did you move the datadirectory manually then move it back or anything like that)?
  • Can you confirm there aren’t some additional log entries immediately before/after that log entry?

/data is an NFS mount, has always been.
Nextcloud is running in a VM, the NFS mount is from the host machine, running Proxmox. It is reliable, other VMs are also mounting shares, no errors there.

I perform updates by unzipping a new version into a new folder (on the same NFS share) and then moving the config and /data over. Basically following all the steps described in the manual.

As to log entries, there are more, but not related time-wise. As copy & paste of the log is pretty ugly, I’ve tried to take a screenshot to show what is happening:

This appears to be an issue with expiring old files. And the file that Nextcloud is trying to access/expire over and over again does actually not exist, neither as a regular nor as a deleted file. Not sure how Nextcloud works, but maybe there is an orphaned entry for a file in some database that Nexcloud doesn’t delete?