server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: `occ files:scan --all` scans the same samba share again and again for every user

Open PaulStogov opened this issue 1 year ago • 2 comments

⚠️ This issue respects the following points: ⚠️

Bug description

TIL that running occ files:scan --all command scans over and over again the same SMB share attached to our NC installation and being available for a number of users for every single user account.

image

I got the same pair of errors for every user connected to that one network share. Is seems like a huge overhead for me to scan the same network drive over and over again.

Steps to reproduce

  1. Add an SMB/CIFS storage in "External storage" setting.
  2. Make it "Available for" a number of users.
  3. Run occ files:scan --all command

Expected behavior

One network connected share over anyhow protocol must be scanned one time only.

Installation method

Other Community project

Nextcloud Server version

29

Operating system

Other

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

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

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

PaulStogov avatar Jun 30 '24 05:06 PaulStogov

Some illustrations. Scan time with the SMB share unavailable: image Scan time with the SMB share connected: image It took 7+ hrs more. And the contents of the SMB share is like this: image So it is easily calculable five times overhead.

PaulStogov avatar Jun 30 '24 05:06 PaulStogov

Depends on how the share is made available to the users. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/auth_mechanisms.html#considerations-for-shared-storage

SystemKeeper avatar Jun 30 '24 13:06 SystemKeeper

Depends on how the share is made available to the users. See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/auth_mechanisms.html#considerations-for-shared-storage

Thank you very much for the reply, I read the doc you provided. But it seems for me that my case does not include "user specific authorization":

image

Or it should be "all people" checked?

PaulStogov avatar Jul 03 '24 04:07 PaulStogov

I read the doc you provided. But it seems for me that my case does not include "user specific authorization":

This part from the docs:

If collaborative working on external storage is required, the authentication “Global credentials” has to be used.

So in your case, instead of Login and password.

joshtrichards avatar Mar 24 '25 23:03 joshtrichards