Mounting smb/cifs drive doesn't work

Nextcloud version: 18.0.2
Operating system and version: Debian 10 (in Docker)
Apache version: 2.4.38
PHP version: 7.3.15

The issue you are facing:
I am running Nextcloud in Docker and I want to mount a smb share from OpenMediaVault. The container has the capabilities DAC_READ_SEARCH and SYS_ADMIN set, and from within the container I can mount the drive just fine using

mount -t cifs -o user=<user> //192.168.0.39/PiDrive /mnt

However in Nextcloud itself, it doesn’t work with either the SMB Test app and the External Storage app.

Is this the first time you’ve seen this error?: Yes, because I am trying for the first time.

The output of your Nextcloud log in Admin > Logging: Trying to mount doesn’t seem to log anything.

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  '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,
    ),
  ),
  'instanceid' => 'ocp61qlucysu',
  'passwordsalt' => '<hidden>',
  'secret' => '<hidden>',
  'trusted_domains' =>
  array (
    0 => 'pi.local:8080',
    1 => '192.168.0.39:8080',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '18.0.2.2',
  'overwrite.cli.url' => 'http://pi.local:8080',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud-postgres:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '<hidden>',
  'dbpassword' => '<hidden>',
  'installed' => true,
  'loglevel' => 2,
  'maintenance' => false,
);

The output of your Apache/nginx/system log in /var/log/____: Seems to be empty.

Can I push this?

Can you clarify what you are trying to do? If you are trying to mount SMB as external storage in NC, there is no need to mount it in the OS.

Sorry, I misread that. You mounted it from within the container to test it. You should have an error if you look under Settings > Administration > Logging. I just mounted a bogus drive as a test and it produced an error.

Sorry, wasn’t really focussed on this for a while. But the issue persists. These are the logs (the ip has changed since my original request, so that’s ok):

[no app in context] Error: Icewind\SMB\Exception\ForbiddenException: Invalid request for / (ForbiddenException) at <<closure>>

 0. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php line 62
    Icewind\SMB\Exception\Exception::fromMap({1: "Icewind\\SM ... "}, 1, "/")
 1. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php line 74
    Icewind\SMB\Native\NativeState->handleError("/")
 2. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php line 184
    Icewind\SMB\Native\NativeState->testResult("*** sensitive parameter replaced ***", "smb://192.168.0.26/PiDrive/")
 3. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php line 133
    Icewind\SMB\Native\NativeState->stat("smb://192.168.0.26/PiDrive/")
 4. /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php line 112
    Icewind\SMB\Native\NativeShare->getStat("/")
 5. /var/www/html/apps/files_external/lib/Lib/Storage/SMB.php line 179
    Icewind\SMB\Native\NativeShare->stat("/")
 6. /var/www/html/apps/files_external/lib/Lib/Storage/SMB.php line 297
    OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")
 7. /var/www/html/lib/private/Files/Storage/Common.php line 456
    OCA\Files_External\Lib\Storage\SMB->stat("")
 8. /var/www/html/apps/files_external/lib/Lib/Storage/SMB.php line 613
    OC\Files\Storage\Common->test()
 9. /var/www/html/apps/files_external/lib/config.php line 276
    OCA\Files_External\Lib\Storage\SMB->test("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
10. /var/www/html/apps/files_external/lib/Controller/StoragesController.php line 254
    OC_Mount_Config::getBackendStatus("*** sensitive parameters replaced ***")
11. /var/www/html/apps/files_external/lib/Controller/StoragesController.php line 306
    OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensitive parameters replaced ***")
12. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\Files_External\Controller\StoragesController->show(10, "*** sensitive parameter replaced ***")
13. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Extern ... {}, "show")
14. /var/www/html/lib/private/AppFramework/App.php line 125
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Extern ... {}, "show")
15. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Files_Exte ... r", "show", OC\AppFramework\ ... {}, {id: "10",_route ... "})
16. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({id: "10",_route ... "})
17. /var/www/html/lib/private/Route/Router.php line 299
    call_user_func(OC\AppFramework\ ... {}, {id: "10",_route ... "})
18. /var/www/html/lib/base.php line 1008
    OC\Route\Router->match("/apps/files_external/globalstorages/10")
19. /var/www/html/index.php line 38
    OC::handleRequest()

GET /apps/files_external/globalstorages/10?testOnly=true
from 192.168.0.92 by ynedderhoff at 2020-06-20T15:30:12+00:00