Group folders causes occ:scan files error after occ upgrade from 25.0.5 to 26

I have recently ugraded Nextcloud 25 to 26 via occ shell without noticing any bad behaviour. After that I tried to occ scan files --all but some user accounts provided error “Exception during scan: An exception occured while executing a query: SQLSTATE[25P02]: In failed sql transaction: 7 error …” with few another lines of failing components.

All failing accounts are in the same group using “Group folders”, the other accounts are scanned without errors. When “Group folders” app disabled, scan files goes well.

Nextcloud is running on a dedicated DELL server with Ubuntu 20.02 on Nginx with PH8.1, Postgres DB.

I’ve tried every occ command related to DB and files without any success.

Any suggestions what to try to keep Group folders enabled without scan problems?
Thanks in advance,

Did you run with -vv flag to see which file is causing the trouble?

you could run

occ groupfolders:scan --all

and look if it throws the same error or if it solves the issue.

Thank you for the tip, I didn’t realise I can use -vv flag.

Now I see that while occ files:scan the failing folders are only the Group folders, but not all of them. Seems to me like only the subfolders with added system tags. Will try to untag and repeat - but the problem is, that it is a running instance…

When running occ groupfolders:scan everything is OK - no error.

I’ve also tried to replicate the issue on another nextcloud instance on different server, but there ain’t such problem.

I recently had the same issue. I to use groupfolders. I am migrating away from them though, as I can achieve the same end goal with Nextcloud core, and less dependency when new Nextcloud versions are released. As shared folders are a corner stone of the use of the two nextcloud instances I manage, I needs to ensure that it is not jeopardized when upgrading Nextcloud, and the groupfolders app is not yet supported. That is another topic though…

To the topic: Unless you use OpenZFS as your filesystem, I doubt it is the same issue. However worth to consider: Corrupt files in a folder can cause this.

All filesystems experiences corrupt files over time. This is actually the best reason for using raids, as the filesystem is then self-healing, as a corrupt file is just restored from the mirror, and when another corrupt file occurs in the mirror, it is just restored by the other. However I had a few permanent damaged files and only after restoring the files manually from my ZFS backup, did files:acan --all complete without errors - including all the __groupfolders/ subfolders.

The problem seems to be in tags added by Flow → Automated file tagging.

When I set a rule of tagging as the admin, autotagged folder/file failing while being scanned.

I tried to delete admin rules and set autotagging rules as an user and everything looks alright now!

I am happy. I wouldn’be without your help @ernolf . Thanks a lot! :slight_smile:

Have a good day!