External Storage - Windows Share

Hi,

I have just installed a basic installation on a vanilla Ubuntu server and in the most part it is running well. I have configured LDAP to a Windows Active Directory server and this is pulling information through correctly.

I am trying to add a Windows Share \servername\Company so that users who log in with their LDAP credentials can see the Shared Company data. I have added the folder as ā€œSMB/CIFSā€ with the server name and folder set and also granted access to my test user account.

The folder appears when I log in with the test account but I am unable to expand it. I get the following error:

ā€œThere was an error with message: Empty response from the server. Do you want to review mount point config in admin settings page?ā€

I have tried all the authentication methods available in External Storage but none of them seem to work. Can anybody advise.

Thanks.

There were several issues solved with NC 10.0.1, can you upgrade and try again?

The error with the empty response, is that you Windows server how gives the empty response? Do they show you any errors in their logs?

Hi iā€™m also having this issue - a very complete description of my setup and problem can be found at: https://forums.freenas.org/index.php?threads/how-to-give-nextcloud-acces-to-my-share-v2.54905/

  • Iā€™m using nextcloud 11.0.1 in a freebsd jail.
  • Iā€™ve got nextcloud joined to active directory.
  • Iā€™ve installed pecl-smbclient from ports.

Does anybody have an idea of why i might be getting this error? is there somewhere i can look to see more descriptive errors?

I gave up on the freebsd jail a tired building a ubuntu LTS 16.04 vm instead but Iā€™m still getting the exact same issue as above:

i found these other posts with folks having similar issues:

and these related owncloud problems

Can't connect to Windows share (smb3) Empty response from the server - #2 by anon81984126 - Server - ownCloud Central - the just didnā€™t have libsmbclient installed - not my problemā€¦
Unable to use SMB mounts requiring authentication in OC X Ā· Issue #27777 Ā· owncloud/core Ā· GitHub

I should note that Iā€™ve tried the all permutations of IP address, windows host-name, FQDN (as resolved by local dns only but it is a valid FQDN. What i want is to use the login credentials, save in session option but Iā€™ve also tried the simple username a password option witch also doesnā€™t connectā€¦

PROGRESS?!?

iā€™ve got the green light finally but NC is barfing up errors when i try to access anythingā€¦

since last post Iā€™ve done three things:

  1. modified smb.conf to : ā€œclient max protocol = SMB2ā€ in the [global] section of /etc/samba/smb.conf
  2. i didnā€™t restart any services after I uninstalled libsmbclient-php - maybe the restart installed that and it was interfering?
  3. i installed the lan root certificate authority i created on freenas (after having scpā€™d it over) as per https://askubuntu.com/questions/645818/how-to-install-certificates-for-command-line :
Go to /usr/share/ca-certificates/
Create a new folder, i.e. "sudo mkdir school"
Copy the .crt file into the school folder
Make sure the permissions are OK (755 for the folder, 644 for the file)
Run "sudo update-ca-certificates"

here are the errors that nextcloud is generating now:

Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: HTTP/1.1 503 Storage is temporarily not available

/usr/share/nginx/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 939: OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath('someshare')
/usr/share/nginx/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 336: Sabre\DAV\Server->getPropertiesForPath('someshare', Array, 1)
[internal function] Sabre\DAV\CorePlugin->httpPropFind(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/nginx/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/usr/share/nginx/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PROPFIND', Array)
/usr/share/nginx/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/usr/share/nginx/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/usr/share/nginx/nextcloud/remote.php - line 165: require_once('/usr/share/ngin...')
{main}

and also:

Error	files_external	OCP\Files\StorageNotAvailableException: Unknown error (tree connect failed: NT_STATUS_ACCESS_DENIED)

/usr/share/nginx/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 171: OCA\Files_External\Lib\Storage\SMB->getFileInfo('/Visual Media')
/usr/share/nginx/nextcloud/lib/private/Files/Storage/Common.php - line 439: OCA\Files_External\Lib\Storage\SMB->stat('')
/usr/share/nginx/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 438: OC\Files\Storage\Common->test()
/usr/share/nginx/nextcloud/apps/files_external/lib/config.php - line 233: OCA\Files_External\Lib\Storage\SMB->test(false, false)
/usr/share/nginx/nextcloud/apps/files_external/lib/Controller/StoragesController.php - line 255: OC_Mount_Config getBackendStatus('\\OCA\\Files_Exte...', Array, false, false)
/usr/share/nginx/nextcloud/apps/files_external/lib/Controller/UserGlobalStoragesController.php - line 121: OCA\Files_External\Controller\StoragesController->updateStorageStatus(Object(OCA\Files_External\Lib\StorageConfig), false)
[internal function] OCA\Files_External\Controller\UserGlobalStoragesController->show(4, false)
/usr/share/nginx/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/usr/share/nginx/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files_External\Controller\UserGlobalStoragesController), 'show')
/usr/share/nginx/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files_External\Controller\UserGlobalStoragesController), 'show')
/usr/share/nginx/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OCA\\Files_Exter...', 'show', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/usr/share/nginx/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/usr/share/nginx/nextcloud/lib/base.php - line 1010: OC\Route\Router->match('/apps/files_ext...')
/usr/share/nginx/nextcloud/index.php - line 40: OC handleRequest()
{main}

Just to try to resolve what got me to ā€˜green light statusā€™ iā€™ll toggle those things i did and get back with resultsā€¦

edit 1: changing or removing the sub-folder parameter doesnā€™t change the errorsā€¦

confirmed! ubuntuā€™s libsmbclient-php was the "red light culprit!

I just reran apt-get install libsmbclient-php rebooted (i probably could restarted nginx or php or something). and the red light came back again. removed it again and the green light is back.

to summarize:

  1. smb.conf mod did nothing - red herring
  2. libsmbclient-php - bingo - wrong library! - you need to use php-smbclient!
  3. installing my root cert did nothing - i was wondering if it was a bad cert error or something but nah.

ok so the main interface is back and giving the error again:

storage is temporarily not available 

googling this it seems that there may be a problem with the version of php-smbclient provided by ubuntu or php-config or the error lives in nexcloud orā€¦:

and
https://github.com/owncloud/core/issues/24460
and

and
https://github.com/nextcloud/server/issues/3335 (see the bit about smb)

?!

Hi, so after alot of installing, uninstalling, general futzing i decided to actually try connecting with smbclient on the command line. It turns out that the strings that smbclient wants are different that what youā€™d use to mount an smb share using the ā€˜mountā€™ command. The biggest difference is that it wanted to use the old school nebios domain. I gave it that and everything worked. Then i tried it in nextcloud and ā€¦ bingo! so for me at least that was the solution.

ā€¦ could be the funky open-source server stack iā€™ve got going ā€¦ no windows servers just a bunch of unix machines pretending to be windowsā€¦

ā€¦ this may or may not be a general solutionā€¦

Hi,

I have the same configuration and Iā€™m facing the same non-working behaviour. By configuring the external storage with the netbios domain name I was able to get a ā€œgreen lightā€. I can browse through the directories and see the files but: When I try to access a file, I canā€™t. The logfile shows:

Error PHP fread(): \Icewind\SMB\NativeStream::stream_read - read -8193 bytes more data than requested (-1 read, 8192 max) - excess data will be lost at /var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php#83

I hope that this issue could be solved soon since (from my personal view) this is one of the most important use cases.

Ā©opeman

Hi,

after some more study it came up that the smbclient seems to handle the smb share NOT correctly if the windows server uses deduplication on the underlying storage. Referring to this article: Corrupt Files From an SMB External File Source
I changed the smb.conf in the following way:

[general]
min client protocol = SMB2
max client protokol = SMB3

Everything works fine now :slight_smile:

Ā©opeman

Same problem on ArchLinux. Nextcloud 12.0.3, smbclient: 4.7.1. Try both: php-smbclient and php-smbclient-git. Smb server located on same Arch machine and has ā€œclient min protocol = SMB2ā€ in config. Most important: no any logs (no warning, no errors, nothing) about establish smb connection in nextcloud.log (log level = 0 i.e. debug). Is anybody know how to trace nextcloud smb connection or run it manually and extract any information about problem?