External smb storage can't connect

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:

example

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

longer
example
here

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): 28
Operating system and version (eg, Ubuntu 20.04): ubuntu 22
Apache or nginx version (eg, Apache 2.4.25): apache_2.4.5.2
PHP version (eg, 7.4): 8.3.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Fresh Install
  2. Connect smb external storage to windows share using AD credentials

The output of your Nextcloud log in Admin > Logging:

Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:06 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:06 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:05 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:05 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized. Unknown error
External storage not available: Storage unauthorized. Unknown error
13 mars 2024, 20:47:04 	
Erreur	no app in context	
ConnectException Unknown error
Error while getting file info
13 mars 2024, 20:47:04 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:04 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:04 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:04 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:04 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:04 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:04 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized. Unknown error
External storage not available: Storage unauthorized. Unknown error
13 mars 2024, 20:47:04 	
Erreur	no app in context	
ConnectException Unknown error
Error while getting file info
13 mars 2024, 20:47:04 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized.
External storage not available: Storage unauthorized.
13 mars 2024, 20:47:03 	
Erreur	no app in context	
ConnectionRefusedException Error while getting file info
Error while getting file info
13 mars 2024, 20:47:03 	
Avertissement	no app in context	
StorageAuthException Storage unauthorized. Unknown error
External storage not available: Storage unauthorized. Unknown error 

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

root@nextcloud:~# cat /var/www/nextcloud/config/config.php 
<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'cloud.danobat.fr',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'https://192.168.10.105',
  'dbname' => 'xxxxxxxxxxxxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxxxxx',
  'dbpassword' => 'xxxxxxxxxxxxxxxxx',
  'installed' => true,
  'default_phone_region' => 'FR',
  'htaccess.RewriteBase' => '/',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'trashbin_retention_obligation' => 'auto, 15',
  'filelocking.enabled' => 'true',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => '0',
    'timeout' => '0.0',
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'app_install_overwrite' => 
  array (
    0 => 'ransomware_protection',
  ),
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'xxxxxxxxxxxxxxxxxx',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxxxxxxxxxxxxxxxxxx',
  'mail_smtppassword' => 'xxxxxxxxxxxxx',
  'defaultapp' => '',
)

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

PASTE HERE

PASTE 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.

File":"/var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Connection.php","Line":57},"message":"External storage not available: Storage unauthorized. ","exception":{},"CustomMessage":"External storage not available: Storage unauthorized. "}}

Seems problem is in Creds, if you check logs:

There is also App to test connectivity to SAMBA: SMB connection test - Apps - App Store - Nextcloud

thanks fo your reply,
I tried many credentials, they all work accessing the share from windows explorer.
Tried to create a new share, set “everybody” “rwx” as share permissions and security permissions but no luck
Those credentials work to authenticate in nextcloud against Active directory
telnet works on port 445 and 139

I tried smb test apps but it looks buggy, it generates a bunch of errors in nextcloud log and nothing happens when I try it