[SOLVED] External Storage with Samba does not connect

I just set up a nextcloud (17.0.1) on Ubuntu 19.10 Server (Apache2, MariaDB, PHP7.3).
Unfortunately I can not get external storage support with SMB working. While entering the needed credentials I always get the red icon. smbclient and php-smbclient are installed.

Testing the SMB connetion via Commandline Interface is working. Testing with a small php-script I found in this forum ist working aswell. If I use the SMB-Connection Test-App the directory listing is empty.

The nextcloud Log is empty and does not list any SMB related Errors. If you need further information I will be happy to supply them. Thanks for your answers.

1 Like

Same issue here:
NC: 17.0.1
Host: Debian 10 (Docker - Nextcloud:17-fpm)

Everything works from CLI using SMBCLIENT, etc. Running in the GUI errors out.

Getting the error below:
Error while loading share content.

Icewind\SMB\Exception\ConnectionException: Connection not valid

0. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 412:Icewind\SMB\Wrapped\Connection->read()
1. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 146:Icewind\SMB\Wrapped\Share->execute("cd \"\"")
2. /var/www/html/custom_apps/smb_test/lib/Controller/SmbController.php - line 95:Icewind\SMB\Wrapped\Share->dir(null)
3. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 170:OCA\SMBTest\Controller\SmbController->dir(null, null, null, null, Icewind\SMB\ ... }}, null)
4. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:OC\AppFramework\Http\Dispatcher->executeController(OCA\SMBTest\ ... {}, "dir")
5. /var/www/html/lib/private/AppFramework/App.php - line 126:OC\AppFramework\Http\Dispatcher->dispatch(OCA\SMBTest\ ... {}, "dir")
6. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:OC\AppFramework\App::main("OCA\\SMBTes ... r", "dir", OC\AppFramew ... {}, { _route: "smb_test.smb.dir"})
7. OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "smb_test.smb.dir"})
8. /var/www/html/lib/private/Route/Router.php - line 297:call_user_func(OC\AppFramew ... {}, { _route: "smb_test.smb.dir"})
9. /var/www/html/lib/base.php - line 1000:OC\Route\Router->match("/apps/smb_test/dir")
10. /var/www/html/index.php - line 42:OC::handleRequest()

I found a solution here:

now it is working again!

is it possible to get this answer in English?
I dont speak German.
i hvae the same issue.

Do you know Google translator? :wink:

  1. Change to the directory /apps/files_external/lib/Lib/Backend.
  2. Create a backup copy of the relevant file cp -p SMB.php SMB.php.ORG
  3. Search for the following line in SMB.php
    56:  (new DefinitionParameter('timeout', $l->t('Timeout')))      
    57:               ->setType(DefinitionParameter::VALUE_HIDDEN) 
    58: ])
    and insert this line below line 57:

After you’ve applied the change you should be able to enhance/modify the externa storage again (There is usually no need to restart Nextcloud).

I added that definition parameter, restarted ubuntu and still get the same error as Cybersecfun.

icewind’s example.php composer test works fine as well as smbclient through terminal, but i’ve spent days on this and can’t get my windows server shares to mount