External Storage SMB not working for everyone

[/details]

Nextcloud version (eg, 20.0.5): 27.1.1
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): as per Docker image
PHP version (eg, 7.4): as per Docker image

The issue you are facing:
I have set up external storage via SMB to a local server (OMV) for three users. One user can actually see the content of the attached storage, the two others cannot see anyting (“No files found”). It is even the same shared folder that one user can see that the other user cannot see.

When I try and trigger a file scan for one of the users, I get a list of errors "Error during Scan: Couldn’t get xattr for smb://redacted/somefile: unknown error (13)

But the strange thing is: the files that trigger the errors are on a shared folder and for the other user they don’t trigger this issue…

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

Steps to replicate it:

  1. Enable External Storage for users
  2. Set up External Storage SMB for some users
  3. For some it works for others it doesn’t

The output of your Nextcloud log in Admin > Logging:

OCP\Files\ForbiddenException: Invalid request for / (ForbiddenException)
/var/www/html/apps/files_external/lib/Lib/Storage/SMB.php - line 352:

OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")

/var/www/html/lib/private/Files/Storage/Common.php - line 465:

OCA\Files_External\Lib\Storage\SMB->stat("")

/var/www/html/apps/files_external/lib/Lib/Storage/SMB.php - line 733:

OC\Files\Storage\Common->test()

/var/www/html/apps/files_external/lib/MountConfig.php - line 131:

OCA\Files_External\Lib\Storage\SMB->test("*** sensiti ... *", "*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/StoragesController.php - line 287:

OCA\Files_External\MountConfig::getBackendStatus("*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/StoragesController.php - line 363:

OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/UserStoragesController.php - line 110:

OCA\Files_External\Controller\StoragesController->show("7", "*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Files_External\Controller\UserStoragesController->show("7", "*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController([ "OCA\\File ... "], "show")

/var/www/html/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch([ "OCA\\File ... "], "show")

/var/www/html/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main("OCA\\Files_ ... r", "show", [ "OC\\AppFr ... "], [ "7","files ... "])

/var/www/html/lib/base.php - line 1068:

OC\Route\Router->match("/apps/files ... 7")

/var/www/html/index.php - line 36:

OC::handleRequest()

Caused by Icewind\SMB\Exception\ForbiddenException: Invalid request for / (ForbiddenException)
/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 75:

Icewind\SMB\Exception\Exception::fromMap([ "Icewind\\ ... "], 13, "/")

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 92:

Icewind\SMB\Native\NativeState->handleError("/")

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php - line 351:

Icewind\SMB\Native\NativeState->testResult("*** sensiti ... *", "smb://redacted")

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php - line 305:

Icewind\SMB\Native\NativeState->getxattr("smb://redacted", "system.dos_attr.*")

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php - line 43:

Icewind\SMB\Native\NativeShare->getAttribute("/", "system.dos_attr.*")

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php - line 69:

Icewind\SMB\Native\NativeFileInfo->stat()

/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php - line 114:

Icewind\SMB\Native\NativeFileInfo->getSize()

/var/www/html/apps/files_external/lib/Lib/Storage/SMB.php - line 191:

Icewind\SMB\Native\NativeShare->stat("/")

/var/www/html/apps/files_external/lib/Lib/Storage/SMB.php - line 352:

OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")

/var/www/html/lib/private/Files/Storage/Common.php - line 465:

OCA\Files_External\Lib\Storage\SMB->stat("")

/var/www/html/apps/files_external/lib/Lib/Storage/SMB.php - line 733:

OC\Files\Storage\Common->test()

/var/www/html/apps/files_external/lib/MountConfig.php - line 131:

OCA\Files_External\Lib\Storage\SMB->test("*** sensiti ... *", "*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/StoragesController.php - line 287:

OCA\Files_External\MountConfig::getBackendStatus("*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/StoragesController.php - line 363:

OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensiti ... *")

/var/www/html/apps/files_external/lib/Controller/UserStoragesController.php - line 110:

OCA\Files_External\Controller\StoragesController->show("7", "*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Files_External\Controller\UserStoragesController->show("7", "*** sensiti ... *")

/var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController([ "OCA\\File ... "], "show")

/var/www/html/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch([ "OCA\\File ... "], "show")

/var/www/html/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main("OCA\\Files_ ... r", "show", [ "OC\\AppFr ... "], [ "7","files ... "])

/var/www/html/lib/base.php - line 1068:

OC\Route\Router->match("/apps/files ... 7")

/var/www/html/index.php - line 36:

OC::handleRequest()

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' => 
  array (
    'host' => 'redis-nextcloud',
    'port' => 6379,
    'password' => 'redacted',
  ),
  '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,
    ),
  ),
  'trusted_proxies' => 
  array (
    0 => 'redacted',
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'redacted',
  'mail_smtpport' => '2500',
  'mail_smtpsecure' => '',
  'mail_smtpauth' => false,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => '',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'redacted',
  'mail_smtppassword' => '',
  'instanceid' => 'redacted',
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' => 
  array (
    0 => 'redacted',
    1 => 'redacted',
  ),
  'datadirectory' => '/mnt/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '27.1.1.0',
  'overwritehost' => 'redacted',
  'overwrite.cli.url' => 'https://redacted',
  'overwriteprotocol' => 'https',
  'default_phone_region' => 'DE',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'redactedBLP65t',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'rocketchat_nextcloud',
    1 => 'social',
    2 => 'apporder',
    3 => 'twofactor_reminder',
    4 => 'hibp',
  ),
  'memories.exiftool' => '/var/www/html/custom_apps/memories/exiftool-bin/exiftool-amd64-glibc',
  'bulkupload.enabled' => false,
  'filesystem_check_changes' => 1,
  'simpleSignUpLink.shown' => false,
  'preview_max_memory' => 4096,
  'preview_max_filesize_image' => 256,
  'memories.vod.path' => '/var/www/html/custom_apps/memories/exiftool-bin/go-vod-amd64',
  'memories.gis_type' => 1,
  'onlyoffice' => 
  array (
    'jwt_header' => 'Authorization',
    'jwt_secret' => 'redacted',
  ),
);

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

(Sorry, I found these files but they are only links to the stdout/stderr)

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.

(Sorry, can't find this file)

so… any thoughts on this?

Anybody having the same issues? Or anybody who doesn’t experience this issue?

How are you storing credentials for SMB?

Some modes aren’t compatible with Sharing, for example. See the NC Admin Manual section on SMB Authentication.