Files_external - SMB not working

Hello everyone,

I am trying to troubleshoot an issue I am having with a nextcloud installation. In order to nail down the issue, I have created a completely fresh installation on a pretty vanilla Ubuntu 20.04 LST server. nextcloud is running in a docker container, as are the mariadb database I use for it, the redis server, nginx as proxy, and samba also runs in a container.

In the docker container for nextcloud, I have installed cifs-utils, libsmbclient, procps and samba-client.

My problem: I simply cannot get files_external to include a simple SMB share.

The issues does not leave any output in the log file. I started with an empty log file, and nothing was added.

I installed the “SMB Test” app, and, as expected, it also cannot connect to the SMB share.

If I go into the nextcloud docker container and attempt to connect to the SMB share using smbclient, it works just fine, so there does not seem to be any issue with this on the samba server side.

Oh, and just in case, I am fully aware of this: https://github.com/nextcloud/server/issues/17846

I checked, and since I habe nextcloud version 18, the solution explained in that issue is already in place, so that is not the solution.

Everything I checked has turned out to be a dead end, so I am stumped. Does anyone have an idea what I can try?

Data:

Nextcloud version: 18.0.4.2
Container: nextcloud:stable-fpm-alpine
Operating system and version: Ubuntu 20.04 LTS server
nginx version: 1.18.0
PHP version: 7.3.18
mariaDB version: 10.4.13

The issue you are facing: SMB shares cannot be included; when trying to connect, system stalls for a while, then red “error” icon is shown.

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. Activate “files_external” app
  2. Go to server settings, “External Storage” section
  3. Attempt to add a SMB share

The output of the Nextcloud log in Admin > Logging:

    - none - 

The outout of the “SMB Test” app:

Using backend: smbclient

Error while loading share content.

Icewind\SMB\Exception\ConnectionException: Connection not valid

	/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 420:

	Icewind\SMB\Wrapped\Connection->read()

	/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 150:

	Icewind\SMB\Wrapped\Share->execute("cd \"\"")

	/var/www/html/custom_apps/smb_test/lib/Controller/SmbController.php - line 95:

	Icewind\SMB\Wrapped\Share->dir(null)

	/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 170:

	OCA\SMBTest\Controller\SmbController->dir(null, null, null, null, Icewind\SMB\ ... }}, null)

	/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 99:

	OC\AppFramework\Http\Dispatcher->executeController(OCA\SMBTest\ ... {}, "dir")

	/var/www/html/lib/private/AppFramework/App.php - line 125:

	OC\AppFramework\Http\Dispatcher->dispatch(OCA\SMBTest\ ... {}, "dir")

	/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"})

	OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "smb_test.smb.dir"})

	/var/www/html/lib/private/Route/Router.php - line 299:

	call_user_func(OC\AppFramew ... {}, { _route: "smb_test.smb.dir"})

	/var/www/html/lib/base.php - line 1008:

	OC\Route\Router->match("/apps/smb_test/dir")

	/var/www/html/index.php - line 38:

	OC::handleRequest()

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'password' => false,
    'port' => 6379,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'myserver',
  'mail_smtpport' => '25',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '-- removed --',
  'mail_domain' => '-- removed --',
  'passwordsalt' => '-- removed --',
  'secret' => '-- removed --',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '-- removed --',
    2 => '-- removed --',
    3 => 'myserver',
  ),
  'datadirectory' => '/srv/cloud',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'mycloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.-- removed --' => true,
  'dbuser' => 'mycloud',
  'dbpassword' => '-- removed --',
  'installed' => true,
  'instanceid' => 'oc9pyxkhc9y5',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_sendmailmode' => 'smtp',
);

The output of your Apache/nginx/system log in /var/log/____:

    -- no errors --

Hmmm… Doesn’t anybody have any idea?