Unable to create SMB connection to External Storage on Windows 11

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:

I have nextcloud up and running and I got to the point where I want to add an external storage device that has documents/photos on it to share in nextcloud. I chose SMB/CIFS, the storage is on a Windows 11 machine on the same machine. I am running nextcloud on a Hyper-V Ubuntu instance.

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.3
Operating system and version (eg, Ubuntu 20.04): 20.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.41 (Ubuntu)

PHP version (eg, 7.4): 8.1.1

The issue you are facing:

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

Steps to replicate it:

  1. Manually add external storage as SMB/CIFS gives the error in the log file as pasted below.
  2. Smbclient is running ok since connection works fine “smbclient //mymachine/myshare -U myuser”
  3. I am at a loss because I have followed every piece of advice I have seen on other forums including this one.

The output of your Nextcloud log in Admin > Logging:

[no app in context] Warning: OCP\Files\StorageAuthException: Storage unauthorized. Unknown error (do_connect: Connection to  failed (Error NT_STATUS_NOT_FOUND)) at <<closure>>

 0. /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php line 198
 1. /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php line 350
 2. /var/www/html/nextcloud/lib/private/Files/Storage/Common.php line 459
 3. /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php line 731
 4. /var/www/html/nextcloud/apps/files_external/lib/MountConfig.php line 131
 5. /var/www/html/nextcloud/apps/files_external/lib/Controller/StoragesController.php line 288
    OCA\Files_External\MountConfig::getBackendStatus("*** sensitive parameters replaced ***")
 6. /var/www/html/nextcloud/apps/files_external/lib/Controller/StoragesController.php line 363
    OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensitive parameters replaced ***")
 7. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
 8. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
 9. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 172
10. /var/www/html/nextcloud/lib/private/Route/Router.php line 298
11. /var/www/html/nextcloud/lib/base.php line 1023
12. /var/www/html/nextcloud/index.php line 36

GET /nextcloud/index.php/apps/files_external/globalstorages/5?testOnly=true
from by me at 2022-08-04T21:32:31+00:00

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

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://localhost/nextcloud',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mail_from_address' => '',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'ssl',

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

Not sure which log you mean here....

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.