server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: Files from user directory lost when added to grup with groupfolder of the same name

Open mstankie opened this issue 7 months ago • 3 comments

⚠️ This issue respects the following points: ⚠️

Bug description

If there's an users directory named for example 'aaa' in user's main directory, and one creates a group directory named 'aaa' and adds the user to the group, the user's directory 'aaa' gets correctly renamed to 'aaa (1)' (looks like intended behaviour to avoid name conflicts) and all subdirectories of 'aaa' get moved to 'aaa (1)', but files get lost. The files get removed from local drives by Nextcloud client apps.

Steps to reproduce

  1. Create directory named 'aaa' in user's main directory. Create subdir 'aaa/bbb' and 'aaa/ccc'. Make some test files inside subdirs.
  2. Make grup directory 'aaa' owned by a group
  3. Add the user to the grup
  4. The user's 'aaa' directory gets renamed to 'aaa (1)', and all directories from the original 'aaa' dir ('aaa/bbb' and 'aaa/ccc') will be moved to 'aaa (1)/bbb' and 'aaa (1)/ccc', but with no files inside.
  5. The test files get removed from local drives by the Nextcloud local clients.
  6. The new 'aaa' group directory remains empty.

Expected behavior

I expect the renamed, user's directory 'aaa (1)' contains same directory and files as the original 'aaa' directory.

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • [x] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report


List of activated Apps


Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Warning
PHP
Undefined array key "node" at /var/www/html/custom_apps/notes/lib/Service/NoteUtil.php#201

14 kwi 2026, 09:31:26

Error
core
unable to rename, file does not exists : files/OTAS

14 kwi 2026, 09:27:17

Error
no app in context
TypeError
readdir(): Argument #1 ($dir_handle) must be of type resource or null, false given

14 kwi 2026, 09:27:17

Error
webdav
TypeError
readdir(): Argument #1 ($dir_handle) must be of type resource or null, false given

14 kwi 2026, 09:27:17

Warning
PHP
opendir(/mnt/ncdata/maciek/files/OTAS): Failed to open directory: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#130

14 kwi 2026, 09:27:17

Warning
PHP
Attempt to read property "name" on null at /var/www/html/custom_apps/integration_openproject/lib/Controller/ConfigController.php#494

14 kwi 2026, 09:09:57

Additional info

Nextcloud Hub 25 Autumn (32.0.8) Running in Nextcloud AIO.

mstankie avatar Apr 14 '26 08:04 mstankie

The files get removed from local drives by Nextcloud client apps.

Which client apps and which versions?

SystemKeeper avatar Apr 14 '26 14:04 SystemKeeper

Marcel, the client app that did the sync is: Nextcloud Desktop Client wersja 3.16.6daily (Ubuntu)

wt., 14 kwi 2026 o 16:11 Marcel Müller @.***> napisał(a):

SystemKeeper left a comment (nextcloud/server#59619) https://github.com/nextcloud/server/issues/59619#issuecomment-4244551992

The files get removed from local drives by Nextcloud client apps.

Which client apps and which versions?

— Reply to this email directly, view it on GitHub https://github.com/nextcloud/server/issues/59619#issuecomment-4244551992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2KGNKEYVVSFNSCAGPXYM34VZBJLAVCNFSM6AAAAACXYQJ2QGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENBUGU2TCOJZGI . You are receiving this because you authored the thread.Message ID: @.***>

mstankie avatar Apr 16 '26 13:04 mstankie

Faced exact same issue on version: 33.0.5.1 (installed with AIO). But I managed to recover and have smth to add to the story.

The user had a folder folder_name. I've created a team folder folder_name, which caused the user's folder to be renamed to "folder_name (1)". Subfolders under folder_name (1) were shown, but the user was not able do enter them.

So I deleted the team folder and renamed the user's folder back, but this didn't help. The files:repair-tree restored files back: sudo docker exec --user www-data nextcloud-aio-nextcloud php occ files:repair-tree

but after we finally created a team folder with different name and moved the contents there, the contents were lost somewhere in the middle: not showing both in user's folder and in team folder (which is kinda scary). After SEVERAL runs of files:repair-tree all the files seem to be in place (every run on files:repair-tree restored the part of the files).

svinopterix avatar Jul 01 '26 14:07 svinopterix