Shared Folders are not accessible by some users

Nextcloud version (eg, 20.0.5): 24.0.7.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): nginx/1.23.2
PHP version (eg, 7.4): PHP 8.1.12

The issue you are facing:
Some Users are not able to access folders shared to them. This behaviour is browser independent but accessing the Share via iOS App is still working. On the other side other users are able to access the same folder shared to them.

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

Steps to replicate it:

  1. Share a folder to specific user
  2. Try to access the folder via “Shared with You”
  3. Accessing the folder redirects to Home directory
  4. This happens for newly created and then shared folders as well

The output of your Nextcloud log in Admin > Logging:

White Page

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

<?php
$CONFIG = array (
'encryption.legacy_format_support' => false,
'activity_expire_days' => 14,
'allow_local_remote_servers' => true,
'auth.bruteforce.protection.enabled' => true,
'blacklisted_files' =>
array (
0 => '.htaccess',
1 => 'Thumbs.db',
2 => 'thumbs.db',
),
'cron_log' => true,
'default_phone_region' => 'DE',
'default_locale' => 'de_DE',
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\Preview\PNG',
1 => 'OC\Preview\JPEG',
2 => 'OC\Preview\GIF',
3 => 'OC\Preview\BMP',
4 => 'OC\Preview\XBitmap',
5 => 'OC\Preview\Movie',
6 => 'OC\Preview\PDF',
7 => 'OC\Preview\MP3',
8 => 'OC\Preview\TXT',
9 => 'OC\Preview\MarkDown',
),
'filesystem_check_changes' => 0,
'filelocking.enabled' => 'true',
'htaccess.RewriteBase' => '/',
'integrity.check.disabled' => false,
'knowledgebaseenabled' => false,
'log_type' => 'file',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'loglevel' => '0',
'logtimezone' => 'Europe/Berlin',
'log_rotate_size' => '104857600',
'maintenance' => false,
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'overwriteprotocol' => 'https',
'preview_max_x' => 1024,
'preview_max_y' => 768,
'preview_max_scale_factor' => 1,
'redis' =>
array (
'host' => '/var/run/redis/redis-server.sock',
'port' => 0,
'timeout' => 0.5,
'dbindex' => 1,
),
'theme' => '',
'quota_include_external_storage' => false,
'share_folder' => '/Shares',
'skeletondirectory' => '',
'trashbin_retention_obligation' => 'auto, 7',
'updater.release.channel' => 'stable',
'instanceid' => 'xxx',
'passwordsalt' => 'xxx',
'secret' => 'xxx',
'trusted_domains' =>
array (
0 => 'xxx',
1 => 'xxx',
2 => 'xxx',
3 => 'xxx',
4 => 'xxx',
5 => 'xxx',
6 => 'xxx',
7 => 'xxx',
8 => '127.0.0.1',
),
'datadirectory' => 'xxx',
'overwrite.cli.url' => 'xxx',
'dbtype' => 'mysql',
'version' => '24.0.7.1',
'dbname' => 'xxx',
'dbhost' => 'localhost:/var/run/mysqld/mysqld.sock',
'dbtableprefix' => 'oc_',
'dbuser' => 'xxx',
'dbpassword' => 'xxx',
'installed' => true,
'mail_from_address' => 'cloud',
'mail_smtpmode' => 'sendmail',
'mail_domain' => 'xxx',
'mail_smtphost' => 'xxx',
'mail_smtpport' => 'xx',
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => '\OCA\User_LDAP\LDAPProviderFactory',
'mysql.utf8mb4' => true,
'encryption.key_storage_migrated' => false,
'trusted_proxies' =>
array (
0 => '127.0.0.1',
1 => '::1',
),
'remember_login_cookie_lifetime' => '1800',
'versions_retention_obligation' => 'auto, 365',
'simpleSignUpLink.shown' => false,
'upgrade.disable-web' => true,
'mail_sendmailmode' => 'smtp',
'app_install_overwrite' =>
array (
0 => 'mindmap_app',
),
'log.condition' =>
array (
'apps' =>
array (
0 => 'admin_audit',
),
),
);

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

{"time_local":"16/Nov/2022:12:00:04 +0100","remote_addr":"10.8.x.x","remote_user":"","request":"PROPFIND /remote.php/dav/files/user_dir/Shares/shared_dir HTTP/2.0","status": "404","body_bytes_sent":"203","request_time":"0.033","http_referrer":"","http_user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0"}
{"time_local":"16/Nov/2022:12:00:05 +0100","remote_addr":"10.8.x.x","remote_user":"","request":"PROPFIND /remote.php/dav/files/user_dir/ HTTP/2.0","status": "207","body_bytes_sent":"5438","request_time":"0.045","http_referrer":"","http_user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0"}
{"time_local":"16/Nov/2022:12:00:05 +0100","remote_addr":"10.8.x.x","remote_user":"","request":"GET /apps/files/ajax/getstoragestats?dir=%2F HTTP/2.0","status": "200","body_bytes_sent":"216","request_time":"0.019","http_referrer":"","http_user_agent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0"}

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.

{"reqId":"VNY03xA8cm02KfNZdmv8","level":0,"time":"2022-11-16T12:00:04+01:00","remoteAddr":"10.8.x.x","user":"user","app":"drawio","method":"PROPFIND","url":"/remote.php/dav/files/user_dir/Shares/shared_dir","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"24.0.7.1","data":{"app":"drawio"}}
{"reqId":"VNY03xA8cm02KfNZdmv8","level":0,"time":"2022-11-16T12:00:04+01:00","remoteAddr":"10.8.x.x","user":"user","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/user_dir/Shares/shared_dir","message":"mount at /user_dir/files/Shares/other_shared_dir/ has no provider set, performing full setup","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"24.0.7.1","data":[]}
{"reqId":"VNY03xA8cm02KfNZdmv8","level":0,"time":"2022-11-16T12:00:04+01:00","remoteAddr":"10.8.x.x","user":"user","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/user_dir/Shares/shared_dir","message":"File with name /Shares/shared_dir could not be located","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"24.0.7.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"File with name /Shares/shared_dir could not be located","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":971,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":358,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":170,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","Line":242,"CustomMessage":"--"}}
{"reqId":"ahV7Q9wHar6uiBxTWzO9","level":0,"time":"2022-11-16T12:00:05+01:00","remoteAddr":"10.8.x.x","user":"user","app":"drawio","method":"PROPFIND","url":"/remote.php/dav/files/user_dir/","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0","version":"24.0.7.1","data":{"app":"drawio"}}

Should be [Bug]: Shares missing in web when 'mount_provider_class' is empty · Issue #34752 · nextcloud/server · GitHub
Please have a look.