External Storage - SMB/CIFS not working after disabling SMBv1

Nextcloud version (eg, 10.0.2): 11.0.3
Operating system and version (eg, Ubuntu 16.04): Debian 8.0
Apache or nginx version (eg, Apache 2.4.25): 1.6.2
PHP version (eg, 5.6): 5.6
Is this the first time you’ve seen this error?: Yes

Can you reliably replicate it? (If so, please outline steps):

  1. Setup External Storage using SMB/CIFS in Nextcloud and make sure it’s working properly (i.e. you can see files etc)
  2. Disable SMBv1 protocol use by Samba server by adding following line in smb.conf [global] section: min protocol = SMB2
  3. Restart Samba daemon (systemctl restart smbd)
  4. Log back in to Nextcloud and try now to access files.
  5. Result: Storage is temporarily not available
    The issue you are facing:

The output of your Nextcloud log in Admin > Logging:

Error files_external OCP\Files\StorageNotAvailableException: Unknown error (protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE) 2017-05-30T13:09:26+1000
Error files_external OCP\Files\StorageNotAvailableException: Unknown error (protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE) 2017-05-30T13:09:26+1000
Fatal webdav Sabre\DAV\Exception\ServiceUnavailable: HTTP/1.1 503 Storage is temporarily not available

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

<?php $CONFIG = array ( 'instanceid' => 'instanceid', 'passwordsalt' => 'salt', 'secret' => '****', 'trusted_domains' => array ( 0 => 'nextcloud-public', 1 => '*****', 2 => '*****', ), 'datadirectory' => '/mnt/data', 'overwrite.cli.url' => 'https://nextcloud-public', 'dbtype' => 'mysql', 'version' => '11.0.3.2', 'dbname' => 'nextcloud_public', 'dbhost' => '****', 'dbtableprefix' => 'oc_', 'dbuser' => 'public', 'dbpassword' => 'pwd', 'logtimezone' => 'UTC', 'installed' => true, 'memcache.local' => '\\OC\\Memcache\\APCu', 'theme' => '', 'loglevel' => 2, 'maintenance' => false, );

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

172.17.0.1 - - [15/Mar/2017:15:31:35 +1000] “GET /oc/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:35 +1000] “GET /oc-shib/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:35 +1000] “GET /nextcloud/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:35 +1000] “GET /status.php HTTP/1.0” 200 145 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:35 +1000] “GET /owncloud/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:59 +1000] “GET /nextcloud/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:59 +1000] “GET /owncloud/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:59 +1000] “GET /oc/status.php HTTP/1.0” 200 12758 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:59 +1000] “GET /status.php HTTP/1.0” 200 145 “-” "GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1"
172.17.0.1 - - [15/Mar/2017:15:31:59 +1000] “GET /oc-shib/status.php HTTP/1.0” 200 12758 “-” “GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.0.13-0ubuntu0.16.04.1”

1 Like

After the WannaCry vulnerability broke loose weeks ago. most companies disabled SMB v1, and sadly, Nextcloud 12 with latest php-smbclient still could not connect to Windows SMB v3 in a joined Domain.

Using smbclient commands, I could browse the DFS by using the “-m SMB3” options. Other reported ini php-smbclient’s GitHub Issues Tracker that ownCloud didn’t have this problem.

smbclient //dfs/Data -U domain\\chrone81 -m SMB3
smbclient //dfs/Data -U domain/chrone81 -m SMB3

Really looking for the fix to connect to SMB v3. :slight_smile:

Reference:

try to force a minimum of smbv2

sorry, it would not let me link…

add in global section smb.conf (/etc/samba/smb.conf)

client min protocol = SMB2
client max protocol = SMB3

resolves issue.
:+1: 1

1 Like

Thanks for the hint. It still could not work. Perhaps becasue the samba server is on Windows Domain?

Do you use full samba server or just the smbclient package? Also do you php-smbclient as well or php-smb or no php smb module at all?

Mine is on a windows domain. I am only using the client (smbclient) and the cifs-utils.No php smb at all from what I can tell. I could not mount via the External Storage Support application (I would get a red dot) until I fixed the smb.conf and gave it a reboot.

1 Like

Oh I see, thanks! I’ll try again later without php-smbclient enabled.

Update:
Weird, still could not work.Do you input the domain name in the “Domain” input box in external storage settings? Should it be domain.com or just the domain? Used to work without even have to enter the “Domain”.

For me I have the server name (fully qualified), the Share folder (I only have 1 folder deep), the username (The AD username of a resource account I made for this), the password (password I set in AD for this resource account), and the domain (the entire domain name, so not “CONTOSO” but “CONTOSO.MICROSOFT.COM” ) When I did that and clicked the checkmark, the icon came up green.

1 Like

That works for me! Thx.

Is client max protocol = SMB3 required, or is client min protocol… sufficient?

May i know how you resolve this issue? Because I am not able to mount samba
share. I have installed php-smbclient and sambaclient both but still getting the issue. Please help.

I’m testing Nextcloud on my network and mapping drives from server 2008 is no problem. Servers 2012 and 2016 only shares created on C drive can be mapped not other drives on server. How Nextcloud expect me to buy this for $6000 if this is not working?

This issue has been solved for the person who requested help initially.

If you discover issues in your environment, please open a new thread and describe your issue with more details and furthermore provide some server information (I suggest installing and using the app “issue template” on your server). That way we can help you much better and seek for solution.

Feel free to reference this thread right here if you want to describe what you tried already to solve your problem.

I’m closing this thread.