nextcloud / nextcloud/server

Unavailable SMB external storage blocks access to the entire file view

Open
#29,461 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 25-feedback bug feature: external storage
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Steps to reproduce
  1. Configure an external storage using smb
  2. Use a samba share that has limited number of connections (max connections = x in smb.conf)
  3. Try to access nextcloud when the maximum number of connections on the samba share has been reached
Expected behaviour

Probably the external storage should appear in red just as when the user has no access to it

Actual behaviour

The user logs in, but the error message "This directory is unavailable, please check the logs or contact the administrator" appears and no files or directories appear.

Server configuration

Operating system: Linux custom

Web server: Apache/2.4.41 (Unix)

Database: MariaDB 10.2.29

PHP version: 7.3.27

Nextcloud version: 21.0.2

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 20.0.8

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: SMB

Are you using encryption: no

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

Client configuration

Browser: Firefox

Operating system: Windows 10

Logs
Web server error log
Web server error log
Insert your webserver log here
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"mBxfbezt8u5VVQkSpI2U","level":1,"time":"2021-10-27T13:26:14+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"karagian","app":"lib","method":"PROPFIND","url":"/cs/remote.php/dav/files/karagian/","message":"Storage with shared::c3f884e09f90a4f4fb9ff44bfc071298 marked as unavailable","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0","version":"21.0.2.1"}
{"reqId":"mBxfbezt8u5VVQkSpI2U","level":4,"time":"2021-10-27T13:26:15+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"karagian","app":"webdav","method":"PROPFIND","url":"/cs/remote.php/dav/files/karagian/","message":{"Exception":"Icewind\\SMB\\Exception\\InvalidArgumentException","Message":"Invalid request for / (InvalidArgumentException)","Code":22,"Trace":[{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":67,"function":"fromMap","class":"Icewind\\SMB\\Exception\\Exception","type":"::","args":[["Icewind\\SMB\\Exception\\ForbiddenException","Icewind\\SMB\\Exception\\NotFoundException","Icewind\\SMB\\Exception\\ForbiddenException","Icewind\\SMB\\Exception\\FileInUseException","Icewind\\SMB\\Exception\\AlreadyExistsException","And 11 more entries, set log level to debug to see all entries"],22,"/"]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":84,"function":"handleError","class":"Icewind\\SMB\\Native\\NativeState","type":"->","args":["/"]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":338,"function":"testResult","class":"Icewind\\SMB\\Native\\NativeState","type":"->","args":[false,"smb://127.0.0.1/COMMON/"]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":305,"function":"getxattr","class":"Icewind\\SMB\\Native\\NativeState","type":"->","args":["smb://127.0.0.1/COMMON/","system.dos_attr.*"]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":43,"function":"getAttribute","class":"Icewind\\SMB\\Native\\NativeShare","type":"->","args":["/","system.dos_attr.*"]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":69,"function":"stat","class":"Icewind\\SMB\\Native\\NativeFileInfo","type":"->","args":[]},{"file":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":114,"function":"getSize","class":"Icewind\\SMB\\Native\\NativeFileInfo","type":"->","args":[]},{"file":"/var/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":193,"function":"stat","class":"Icewind\\SMB\\Native\\NativeShare","type":"->","args":["/"]},{"file":"/var/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":636,"function":"getFileInfo","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->","args":["/"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Common.php","line":114,"function":"filetype","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":115,"function":"is_dir","class":"OC\\Files\\Storage\\Common","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php","line":132,"function":"is_dir","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":115,"function":"is_dir","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":115,"function":"is_dir","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":115,"function":"is_dir","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/Cache/Watcher.php","line":105,"function":"is_dir","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/View.php","line":1350,"function":"update","class":"OC\\Files\\Cache\\Watcher","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/nextcloud/lib/private/Files/View.php","line":1390,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->","args":[{"mountPoint":"/karagian/files/COMMON/","cache":{"__class__":"OC\\Files\\Cache\\Cache"},"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\FilesAccessControl\\StorageWrapper"},"*** sensitive parameter replaced ***","/COMMON"]},{"file":"/var/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":331,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["/karagian/files/COMMON",false]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":765,"function":"getQuotaInfo","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":[]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"Sabre\\DAV\\{closure}","class":"Sabre\\DAV\\CorePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":769,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->","args":["{DAV:}quota-available-bytes",{"__class__":"Closure"}]},{"file":"/var/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["propFind",[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"}]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1661,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["files/karagian",["{DAV:}getlastmodified","{DAV:}getetag","{DAV:}getcontenttype","{DAV:}resourcetype","{http://owncloud.org/ns}fileid","And 14 more entries, set log level to debug to see all entries"],1]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1646,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"elementMap":[],"contextUri":"/cs/remote.php/dav/","namespaceMap":{"DAV:":"d","http://sabredav.org/ns":"s","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc"},"classMap":[],"__class__":"Sabre\\Xml\\Writer"},{"__class__":"Generator"},false]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"file":"/var/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/nextcloud/remote.php","line":167,"args":["/var/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php","Line":44,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0","version":"21.0.2.1"}
Browser log
Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/files_external/lib/Lib/Storage/SMB.php, especially the SMB calls around lines 193 and 636, then trace how the Availability and file-storage wrappers handle the logged exception. Reproduce the unavailable-share scenario described in the steps and inspect the supplied WebDAV trace. Done means an unavailable SMB mount no longer prevents the rest of the file view from appearing and is represented as unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.