After updating to 29.0.4 users have lost access to the local file system

Nextcloud version: 29.0.4.1
Operating system and version: Ubuntu 24.04
Apache or nginx version: Apache 2.4.41
PHP version: 8.1.29

The issue you are facing:
After updating to 29.0.4 users have lost access to the local file system.
Before the update, users had access to their personal files on the local filesystem in the /data dir as well as to external storage.
After the the update all users have lost read and write access to their personal files on the local filesystem. The files and directories still are there in the correct ‘datadirectory’, the permissions and the owner are correct (www-data 755) and the data dir configuration in config.php are pointing to the correct path (‘datadirectory’ => ‘/var/www/html/nextcloud/data’).

However, when going to personal files, neither the files in the related user’s data dir are shown nor the button to create/upload a file is active (hovering over the button says something similar as “you have no rights to create or upload a file at this location”.

For testing reasons, i created a new user and everyhing is working fine for the new user. The new user gets his data directory at the same place as the existing ones have theirs, the dir and file permissions are set identically.

No related log messages in the logs

So my conclusion is: It’s bascially working but something must have gone wrong during the update. Since from what i saw dir structure and permissions on the file systems look correct, could it be there is some information in the database which could lead to this behaviour? Any other idea where it come from?

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

The output of your Nextcloud log in Admin > Logging:

No related log messages in the logs

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

  'datadirectory' => '/var/www/html/nextcloud/data',

Thanks a lot for your support.


Existing Users:


Newly created user after the NC update:

It looks like the Nextcloud database has forgotten all the information about the files. That is bad. You can use

sudo -u www-data php /path/to/nextcloud/occ files:scan --all

to re-read everything. However, shares, for example, will be lost. It is therefore better to look for another solution. Can you possibly restore a backup and repeat the upgrade?

Are any of the configured External Storage mounts for these users offline?

No. There are two SMB and one SFTP mounts and all are working.

Yes, this sounds like a possible explanation.
I will have a look at the database, maybe i find a realted indication.

Rescanning the filesystem did not change the situation.

  • The scan found 0 new files while scanning some 100k files. I think this means that the db still knows all the files.
  • Also the user accounts are in the db (all the records for the users in oc-users look good). Which makes sence since the users can log in.
  • In addition the calenders and address books also are working.
  • It looks like as if NC isn’t able to resolve the user against the user’s files. However, does it really have to? As, if i correctly understand, the user has a record in the db and he has a local storage under his user name in the data directory. So what ever is in that user’s data directory should be shown in the web interface. No additional permission information needed, right?
  • Just to document: the data-dir is accessible by the apache user www-data with the right read/write permissions.
  • Also i found records for all the user’s local storages in oc_storages.

Looking at oc_files_versions, the table only has 47 entries of which 44 refere to the new user i created (“Jessie”) after the update. Also looking at the ids makes me think there is information missing here:

grafik

Looking at oc_filecache, i got some 400k records in the table, which could be correct. All of the have a reference to a storage.

Finally, the fact that not only no files are shown but also the “New” button is deactivated/greyed out, let’s me think it might not be a file related problem per se but rather something on the permissions side or even on the system level. Since, if it only was that NC forgot about files, the user still shoud be able to create new files or folders in his/her space.

It’s related to this issue: [Bug]: Trouble accessing data for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces is enabled w/ external storage and ldap · Issue #42663 · nextcloud/server · GitHub

Turning rich workspaces off occ config:app:set text workspace_available --value=0 brings back the files and the permission to create/upload new files.

So i would consider this a defect.

Thanks a lot @jtr and @devnull for your support!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.