External Storage Access issues - Only some Shares, and different for each user

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, 18.0.2): 20.0.5
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.5 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.29 (Ubuntu)
PHP version (eg, 7.1):7.4.14

The issue you are facing:
My users and I are unable to connect to certain shares, not all, but certain ones. I cannot for the life of me figure out why, but I have my suspicions.
When you try to access the share from the Nextcloud webpage you get “This directory is unavailable, please check the logs or contact the administrator”. Checking the Logs shows the following

Fatal	webdav	Icewind\SMB\Exception\ForbiddenException: Invalid request for /a_.h_ (ForbiddenException)

I changed the name, it is my Cousin’s account. Strange that the error is using different domain credentials than the user that is logged in, me.

When I log in as my cousin, I get that the Admin group was the one trying to access it. He is not a member of that group

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

Steps to replicate it:

  1. Login as a Domain Connected User
  2. Attempt to access one of the External Storage (in the case of me, it is the Users, in the case of my cousin and my friend, it is the server share and the users folders)
  3. Receive “This directory is unavailable, please check the logs or contact the administrator”
  4. Log shows me attempting to connect as a different user (my Cousin), and my cousin shows attempting to connect as the ‘Cloud Admin’ group, which he is not a member of. All of this started since upgrading to 20.04

The output of your Nextcloud log in Admin > Logging:

{"reqId":"rYYAuzBOXnn2cr9byuSQ","level":4,"time":"2021-01-18T16:10:58+00:00","remoteAddr":"10.1.20.113","user":"me","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/charles.hix/Users%20(U)","message":{"Exception":"Icewind\\SMB\\Exception\\ForbiddenException","Message":"Invalid request for /cousin (ForbiddenException)","Code":13,"Trace":[{"file":"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":66,"function":"fromMap","class":"Icewind\\SMB\\Exception\\Exception","type":"::"},{"file":"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":78,"function":"handleError","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":109,"function":"testResult","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":92,"function":"opendir","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":238,"function":"dir","class":"Icewind\\SMB\\Native\\NativeShare","type":"->"},{"file":"/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":610,"function":"getFolderContents","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php","line":158,"function":"getDirectoryContent","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php","line":158,"function":"getDirectoryContent","class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask","type":"->"},{"function":"getDirectoryContent","class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php","line":408,"function":"iterator_to_array"},{"file":"/var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php","line":388,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php","line":340,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/View.php","line":1345,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Files/View.php","line":1389,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":330,"function":"getFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":805,"function":"getQuotaInfo","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":96,"function":"Sabre\\DAV\\{closure}","class":"Sabre\\DAV\\CorePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":809,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1063,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":989,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1678,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1661,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":363,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":167,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php","Line":30,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36","version":"20.0.5.2","id":"6005bb2112395"}

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

<?php
$CONFIG = array (
  'instanceid' => 'redacted',
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' =>
  array (
    0 => 'cloud.hixfamily.us',
  ),
  'datadirectory' => '/media/data',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  'overwrite.cli.url' => 'https://cloud.hixfamily.us',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'htaccess.RewriteBase' => '/',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'redacted',
  'dbpassword' => 'redacted',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'cloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'hixfamily.us',
  'mail_smtphost' => 'mail.hixfamily.us',
  'mail_smtpport' => '25',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' =>
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' =>
  array (
    0 => 'keeweb',
  ),
);

System report
https://cloud.hixfamily.us/s/Ssniywg4HfowZZX
pm me for the access code

Additional information:
Noted this:


But this is the configuration of my netplan:

# network: {config: disabled}
network:
    ethernets:
        ens160:
            addresses:
              - 10.1.20.20/22
            gateway4: 10.1.20.1
            nameservers:
                addresses: [10.1.20.5, 10.1.20.10]
                search:
                  - HOME.HIXFAMILY.US
    version: 2

Not sure why the DNS does not match. I recently changed my network from /24 to /22 maybe that messed something up?

Also, this all started after updating to 20.04. And I am not sure if that broke something also.

As a work of caution, I have 0 programming experiance though I work as a net admin for a living. I am a windows guy by trade. So please bear with me as I struggle through linux.

Thank you.

P.S. I attempted to submit this to reddit first, did not get one upvote or reply. Maybe I am doing something wrong?