Skip to content

[Bug]: Shared Collectives cause "Path not found" when scannig files with "occ files:scan --all" #42496

Open

Description

@arnowelzel

⚠️ This issue respects the following points: ⚠️

Bug description

When a Collective is shared with one or more users and you start a manual file scan using occ files:scan --all, this leads to the following error message for each user who is member of a Collective circle:

Path not found: /username

Where username is the name of the affected user.

Steps to reproduce

  1. Create a collective
  2. Share it with at least one other user
  3. Run occ files:scan --all in a terminal

Expected behavior

occ files:scan --all runs without "Path not found" error messages

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

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

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

There is a workaround to fix this. In /server/lib/private/Files/Utils/Scanner.php the following code needs to be added, so Collectives mounts will be ignored during a file scan:

            // don't scan received local shares, these can be scanned when scanning the owner's storage
            if ($storage->instanceOfStorage(SharedStorage::class)
                || $storage->instanceOfStorage(CollectiveStorage::class)
            ) {
                continue;
            }

Also see https://help.nextcloud.com/t/occ-files-scan-outputs-path-not-found-for-some-users/177507/12 and

// don't scan received local shares, these can be scanned when scanning the owner's storage
if ($storage->instanceOfStorage(SharedStorage::class)) {
continue;

Activity

  1. NL-TCH commented on Mar 14, 2025

    @NL-TCH

    hi, any update on this?

  2. robertoschwald commented on Jun 5, 2025

    @robertoschwald

    We’re affected as well. Using shared Collectives definitely triggers this bug for all other users the Collective is shared with.

  3. Pingger commented on Jun 11, 2025

    @Pingger

    We are affected as well. Now 20% of the Accounts are affected. This seemingly prevents shares from these accounts to be moved to other folders and prevents deleting some files (which are already deleted on the disk) or creating some files (that already exist on disk).
    The error prevents automatic fixing using the occ files:scan --all command and forces me to try to manually fix those errors directly in the database. For now I was only able to fix deletions with direct database interference. Shares, I have no idea how to begin with. Creating files, would involve too much for a single file to do manually.

    The only workaround for now is deleted the entire account and recreate it. Then test scanning, if it still fails, repeat.

    Affected Versions for me:
    Nextcloud 31.0.5 with php 8.4.7

  4. arnowelzel commented on Aug 22, 2025

    @arnowelzel
    ContributorAuthor

    At least on my instance where this happend in the past, this does not occur any longer. occ files:scan --all works without any issues. I have 92 users and around 12 shared Collectives.

    Nextcloud 31.0.8 with 8.3.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions