Mounting SMB Share: "Invalid Hostname"

Trying to mount a share hosted on a domain-joined W2012R2 server.
Nextcloud is running on Ubuntu server and joined to the domain.

I have the external storage module enabled with the following entry:
Auth: Username and password
Host: Tried both the FQDN of the fileserver and the ip address. No slashes (so comp.domain and 192.168.1.4)
Share: \share
Username/password: domain account with access to share. I didn’t use the domain prefix (domain\user) but that doesn’t seem to be an issue (yet).
No remote subfolder or domain. Tried inputting my domain FQN but the status for the share turned red. With the above configuration I get a green circle.

The share appears in my user files, but clicking on it only gives “Storage not available”

Log:

Exception: {“Exception”:“OCP\Files\StorageNotAvailableException”,“Message”:“Invalid hostname”,“Code”:0,“Trace”:“#0 /var/www/nextcloud/apps/files_external/lib/smb.php(157): OC\Files\Storage\SMB->getFileInfo(‘/’)\n#1 /var/www/nextcloud/lib/private/files/storage/common.php(434): OC\Files\Storage\SMB->stat(‘’)\n#2 /var/www/nextcloud/apps/files_external/lib/smb.php(391): OC\Files\Storage\Common->test()\n#3 /var/www/nextcloud/apps/files_external/lib/config.php(231): OC\Files\Storage\SMB->test(false)\n#4 /var/www/nextcloud/apps/files_external/controller/storagescontroller.php(255): OC_Mount_Config::getBackendStatus(‘\\OC\\Files\\Stora…’, Array, false)\n#5 /var/www/nextcloud/apps/files_external/controller/userglobalstoragescontroller.php(117): OCA\Files_External\Controller\StoragesController->updateStorageStatus(Object(OCA\Files_external\Lib\StorageConfig))\n#6 [internal function]: OCA\Files_External\Controller\UserGlobalStoragesController->show(4)\n#7 /var/www/nextcloud/lib/private/appframework/http/dispatcher.php(159): call_user_func_array(Array, Array)\n#8 /var/www/nextcloud/lib/private/appframework/http/dispatcher.php(89): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files_External\Controller\UserGlobalStoragesController), ‘show’)\n#9 /var/www/nextcloud/lib/private/appframework/app.php(110): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files_External\Controller\UserGlobalStoragesController), ‘show’)\n#10 /var/www/nextcloud/lib/private/appframework/routing/routeactionhandler.php(45): OC\AppFramework\App::main(‘OCA\\Files_exter…’, ‘show’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#11 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#12 /var/www/nextcloud/lib/private/route/router.php(276): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n#13 /var/www/nextcloud/lib/base.php(950): OC\Route\Router->match(‘/apps/files_ext…’)\n#14 /var/www/nextcloud/index.php(39): OC::handleRequest()\n#15 {main}”,“File”:“/var/www/nextcloud/apps/files_external/lib/smb.php”,“Line”:119}

The only thing I could decipher was the “invalid hostname,” so I tried the IP address of the file server to cut out the dns middleman to no avail, same error and log entry. I can ping both the IP and the hostname of the fileserver from the nextcloud server.

Dear doggydude,

I had the same problem that you, to resolve this one, I just had to insert the correct path format, as following :

for the unc path : \ownclouddata\owcloud$\Engineering\365

host : ownclouddata
share : owncloud$
sub-folder : Engineering/365

I hope this will help you
Jiriki.Net

Dear Serge,

I receive the exact same error as doggydude described and tried our suggestions but it just does nor help. This does only happen when there is AD authentication involved. If I try the same to connect to a share from an openmediavault NAS for example it works just fine.

Kind Regards,
Heine

I was experiencing a similar error. I am running openmediavault on a different rpi and wanted to mount my SMB shares on nextcloud, the following is the only way I got it to work after several attempts:

Folder Name: anyName
Server: IP or ServerName
Share: /remoteShare
Remote Subfolder: [must stay blank or empty]
Authentication: [All Authentication methods worked. My nextcloud users match my OMV users and share access ]