Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: occ files:scan is interrupted if folder cannot be accessed due to permissions #32234

Closed
5 of 8 tasks
wonx opened this issue May 1, 2022 · 2 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info

Comments

@wonx
Copy link

wonx commented May 1, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When performing a occ files:scan for an external storage, to make sure all files are up to date, if there's any folder to which the current user does not have permissions, the process will just finish and the rest of the files will be left unscanned instead of ignoring that folder and continue the scan. This is an issue, for instance, with .Trash-100* folders.

In my case, the external storage is accessed via SMB.

Steps to reproduce

  1. Mount external storage via SMB
  2. Create a folder that the SMB user cannot access
  3. run occ files:scan

Expected behavior

Ignore the non-accessible directory and continue the scan process.

Installation method

Official Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

MariaDB

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

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

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

Configuration report

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "dbtype": "mysql",
        "version": "23.0.2.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "share_folder": "\/Shared",
        "maintenance": false,
        "filelocking.enabled": false,
        "theme": "",
        "loglevel": 2,
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "enabledPreviewProviders": [
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita"
        ]
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - circles: 23.0.1
  - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_external: 1.15.0
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - firstrunwizard: 2.12.0
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - nextcloud_announcements: 1.12.0
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - password_policy: 1.13.0
  - photos: 1.5.0
  - previewgenerator: 4.0.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - recommendations: 1.2.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - support: 1.6.0
  - survey_client: 1.11.0
  - systemtags: 1.13.0
  - text: 3.4.0
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - viewer: 1.7.0
  - weather_status: 1.3.0
  - workflowengine: 2.5.0
Disabled:
  - admin_audit
  - bruteforcesettings: 2.3.0
  - calendar: 3.0.5
  - contacts: 4.0.6
  - encryption
  - mail: 1.11.1
  - maps: 0.1.9
  - spreed: 13.0.0
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Folder  /user/files/MediaBox/.Trash-1000
Exception during scan: 
#0 /config/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php(624): OCA\Files_External\Lib\Storage\SMB->getFolderContents()
#1 [internal function]: OCA\Files_External\Lib\Storage\SMB->getDirectoryContent()
#2 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(410): iterator_to_array()
#3 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(390): OC\Files\Cache\Scanner->handleChildren()
#4 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(393): OC\Files\Cache\Scanner->scanChildren()
#5 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(342): OC\Files\Cache\Scanner->scanChildren()
#6 /config/www/nextcloud/lib/private/Files/Utils/Scanner.php(258): OC\Files\Cache\Scanner->scan()
#7 /config/www/nextcloud/apps/files/lib/Command/Scan.php(143): OC\Files\Utils\Scanner->scan()
#8 /config/www/nextcloud/apps/files/lib/Command/Scan.php(199): OCA\Files\Command\Scan->scanFiles()
#9 /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#10 /config/www/nextcloud/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
#11 /config/www/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#12 /config/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#13 /config/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#14 /config/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#15 /config/www/nextcloud/console.php(99): OC\Console\Application->run()
#16 /config/www/nextcloud/occ(11): require_once('/config/www/nex...')
#17 {main}

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 455     | 32113 | 00:01:19     |
+---------+-------+--------------+

Additional info

No response

@wonx wonx added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels May 1, 2022
@szaimen
Copy link
Contributor

szaimen commented Jan 9, 2023

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

@pxcask
Copy link

pxcask commented Jan 18, 2025

I have an external USB mounted and NC can access it as external data.
Here, I have the same problem. Some folders are not accessible for the user or group "www-data". The occ scanning process does not simply skip this folder but interrupts the scan completely as soon as such folder is found.
Can the issue be reopened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info
Projects
None yet
Development

No branches or pull requests

3 participants