nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.01k forks source link

External Shares SMB/CIFS folders showing "pending" size (php-smbclient issue) #21391

Closed BigDogJonx closed 3 years ago

BigDogJonx commented 4 years ago

Steps to reproduce

  1. Install Nextcloud 19 on Ubuntu 20.04
  2. Add External Storage Support app, then add an SMB/CIFS share (mine was off a Windows machine)
  3. Go to Files and all directories will remain pending in size. Run occ files:scan --all, will not index/scan files off SMB/CIFS share added.

Expected behaviour

Should show directory sizes and show in occ files:scan

Actual behaviour

Directories will remain "pending" in size until you click on that directory in Nextcloud files, then go back and you will notice it will now show directory folder size, however if there is subdirectories it will not work until you go into each subdirectory. Simpler way would be just to run the command for occ files:scan --all, that should index the files, currently it just scans and reports back the default 16 files and 9 folders but the SMB/CIFS in my case has 1000s of files and 100s of folders.

I have narrowed the issue down to php-smbclient not being installed (and not available to install on Ubuntu 20.04). Without this you cannot get the files:scan to work or folder sizes to show. If I go to the owncloud documentation listed here (Installing and Configuring the External Storage: Windows Network Drives App), and then follow the section to install from source listed here:

# Install it from source
git clone git://github.com/eduardok/libsmbclient-php.git
cd libsmbclient-php ; phpize
./configure
make
sudo make install

Then it works just fine. So I guess question is this a bug now that Ubuntu 20.04 doesnt allow you to install php-smbclient (which on 18.04 was allowed and this was resolved by installing that) or has this been removed to work?

Server configuration

Operating system: Ubuntu 20.04

Web server: Apache

Database: Postgres 12.2

PHP version: 7.4.3

Nextcloud version: (see Nextcloud admin page) 19.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Fresh Install for Nextcloud and Ubuntu 20.04 LTS

Where did you install Nextcloud from: TechandMe script

Login as admin user into your Nextcloud and access 
No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.12.0
  - admin_audit: 1.9.0
  - cloud_federation_api: 1.2.0
  - comments: 1.9.0
  - contactsinteraction: 1.0.0
  - dav: 1.15.0
  - federatedfilesharing: 1.9.0
  - files: 1.14.0
  - files_external: 1.10.0
  - files_pdfviewer: 1.8.0
  - files_rightclick: 0.16.0
  - files_sharing: 1.11.0
  - files_trashbin: 1.9.0
  - files_videoplayer: 1.8.0
  - logreader: 2.4.0
  - lookup_server_connector: 1.7.0
  - notifications: 2.7.0
  - oauth2: 1.7.0
  - password_policy: 1.9.1
  - photos: 1.1.0
  - privacy: 1.3.0
  - provisioning_api: 1.9.0
  - recommendations: 0.7.0
  - serverinfo: 1.9.0
  - settings: 1.1.0
  - sharebymail: 1.9.0
  - support: 1.2.1
  - survey_client: 1.7.0
  - systemtags: 1.9.0
  - text: 3.0.1
  - theming: 1.10.0
  - twofactor_backupcodes: 1.8.0
  - updatenotification: 1.9.0
  - viewer: 1.3.0
  - workflowengine: 2.1.0
Disabled:
  - accessibility
  - encryption
  - federation
  - files_versions
  - firstrunwizard
  - nextcloud_announcements
  - user_ldap

Nextcloud configuration:

Config report ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "192.168.0.113", "ubuntu", "ubuntu" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "19.0.0.12", "overwrite.cli.url": "https:\/\/ubuntu\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "upgrade.disable-web": "true", "log_type": "file", "logfile": "\/var\/log\/nextcloud\/nextcloud.log", "loglevel": "2", "mail_smtpmode": "smtp", "remember_login_cookie_lifetime": "1800", "log_rotate_size": "10485760", "trashbin_retention_obligation": "auto, 180", "versions_retention_obligation": "auto, 365", "simpleSignUpLink.shown": "false", "memcache.local": "\\OC\\Memcache\\APCu", "filelocking.enabled": true, "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0.5, "dbindex": 0, "password": "***REMOVED SENSITIVE VALUE***" }, "logtimezone": "US\/Eastern", "htaccess.RewriteBase": "\/", "maintenance": false } } ```

Are you using external storage, if yes which one: local/smb/sftp/... SMB share (Windows ashare)

Are you using encryption: No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No

Client configuration

Browser: Any browser

Operating system: Not a client side issue

dgalligani commented 3 years ago

No news on that?

majherek commented 3 years ago

I have NC 20.0.6.1 (in docker) and have the same issue.

szaimen commented 3 years ago

Is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

Leon-Kunstek commented 4 weeks ago

Unsurprisingly, 3 years later (NC 29.0.5) the issue persists. Not sure about other types of external storage, however I have the same issue connecting to an external Nextcloud installation via the External Storage app. Copied files over 3 hours ago, still shows "pending" for the file size, until I manually open the folder, at which point the size is automagically known.

Currently running a file scan as recommended by the OP.