Update to NC 19 and PHP 7.4 - External memory samba share errors

Hi guys,

today I updated my NC 18.0.3 installation running on my little homeserver first to NC 18.0.6 and then to 19.0. After that I wanted to fix a few recommondations displayed in the NC web interface for admins. First I added the emoji utf8-?? thing which worked. Then I wanted to solve a long time problem of a very slow web response by upgrading to PHP 7.4 from PHP 7.2. I got that running and everything runs fast and smooth now. Everything? No. I noticed after I did all these steps that I could not access my samba shares from NC. I can access them from my windows machine and switch them on and off in samba.conf. But for some reason NC can not access. I found this ticket:
https://github.com/nextcloud/server/issues/20622#issuecomment-621299479 which seemed to describe a similar problem. But as I understand it this should be solved in NC 19. So what I have might be something else but it seems somehow related.

I am not a pro with websevers and this stuff and could need some help :smiley:.

The log gives me one fatal and one error:
Fatal: Sabre\DAV\Exception\ServiceUnavailable: Storage is temporarily not available
Error: Icewind\SMB\Exception\ForbiddenException: Invalid request for / (ForbiddenException)

Nextcloud version: NC 19.0
Operating system and version: Ubuntu 18.04
Apache: 2.4.29
PHP version: 7.4.6

Is this the first time you’ve seen this error? : Y

Steps to replicate it:
?

The output of your Nextcloud log in Admin > Logging:

{“reqId”:“Cq3T97PtbvHsA70EVeHQ”,“level”:3,“time”:“2020-06-20T19:51:27+00:00”,“remoteAddr”:“context”,“method”:“PROPFIND”,“url”:"/remote.php/webdav/",“message”:{“Exception”:“Icewind\SMB\Exception\ForbiddenException”,“Message”:“Invalid request for / (ForbiddenException)”,“Code”:1,“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”:294,“function”:“testResult”,“class”:“Icewind\SMB\Native\NativeState”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php",“line”:306,“function”:“getxattr”,“class”:“Icewind\SMB\Native\NativeState”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php",“line”:64,“function”:“getAttribute”,“class”:“Icewind\SMB\Native\NativeShare”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php",“line”:83,“function”:“stat”,“class”:“Icewind\SMB\Native\NativeFileInfo”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php",“line”:113,“function”:“getSize”,“class”:“Icewind\SMB\Native\NativeFileInfo”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php",“line”:186,“function”:“stat”,“class”:“Icewind\SMB\Native\NativeShare”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php",“line”:334,“function”:“getFileInfo”,“class”:“OCA\Files_External\Lib\Storage\SMB”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Common.php",“line”:458,“function”:“stat”,“class”:“OCA\Files_External\Lib\Storage\SMB”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php",“line”:697,“function”:“test”,“class”:“OC\Files\Storage\Common”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:473,“function”:“test”,“class”:“OCA\Files_External\Lib\Storage\SMB”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:473,“function”:“test”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:70,“function”:“test”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:84,“function”:“updateAvailability”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:93,“function”:“isAvailable”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:243,“function”:“checkAvailability”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:226,“function”:“file_exists”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/View.php",“line”:1334,“function”:“file_exists”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/View.php",“line”:1383,“function”:“getCacheEntry”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Node/Root.php",“line”:201,“function”:“getFileInfo”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Node/Folder.php",“line”:138,“function”:“get”,“class”:“OC\Files\Node\Root”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Node/Folder.php",“line”:147,“function”:“get”,“class”:“OC\Files\Node\Folder”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/text/lib/Service/WorkspaceService.php",“line”:28,“function”:“nodeExists”,“class”:“OC\Files\Node\Folder”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php",“line”:101,“function”:“getFile”,“class”:“OCA\Text\Service\WorkspaceService”,“type”:"->"},{“file”:"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/PropFind.php",“line”:96,“function”:“OCA\Text\DAV\{closure}”,“class”:“OCA\Text\DAV\WorkspacePlugin”,“type”:"->",“args”:[" sensitive parameters replaced ***"]},{“file”:"/var/www/html/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php",“line”:107,“function”:“handle”,“class”:“Sabre\DAV\PropFind”,“type”:"->"},{“file”:"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“propFind”,“class”:“OCA\Text\DAV\WorkspacePlugin”,“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/appinfo/v1/webdav.php",“line”:82,“function”:“exec”,“class”:“Sabre\DAV\Server”,“type”:"->"},{“file”:"/var/www/html/nextcloud/remote.php",“line”:167,“args”:["/var/www/html/nextcloud/apps/dav/appinfo/v1/webdav.php"],“function”:“require_once”}],“File”:"/var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php",“Line”:30,“CustomMessage”:“Error while getting file info”},“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.12.0”,“version”:“19.0.0.12”,“id”:“5eee68bfa92fb”}

Another Error message:
{“reqId”:“UXUSWa9nRiHXIGAQnQap”,“level”:3,“time”:“2020-06-20T19:32:23+00:00”,“remoteAddr”:“93.208.211.166”,“user”:"–",“app”:“core”,“method”:“GET”,“url”:"/cron.php",“message”:{“Exception”:“OCP\Files\StorageNotAvailableException”,“Message”:“Storage with mount id 6 is not available”,“Code”:1,“Trace”:[{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:528,“function”:“getAvailability”,“class”:“OC\Files\Storage\FailedStorage”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:528,“function”:“getAvailability”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:82,“function”:“getAvailability”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:93,“function”:“isAvailable”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",“line”:243,“function”:“checkAvailability”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",“line”:226,“function”:“file_exists”,“class”:“OC\Files\Storage\Wrapper\Availability”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/View.php",“line”:1161,“function”:“file_exists”,“class”:“OC\Files\Storage\Wrapper\Wrapper”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/View.php",“line”:543,“function”:“basicOperation”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Filesystem.php",“line”:696,“function”:“file_exists”,“class”:“OC\Files\View”,“type”:"->"},{“file”:"/var/www/html/nextcloud/apps/files_versions/lib/Storage.php",“line”:724,“function”:“file_exists”,“class”:“OC\Files\Filesystem”,“type”:"::"},{“file”:"/var/www/html/nextcloud/apps/files_versions/lib/Command/Expire.php",“line”:62,“function”:“expire”,“class”:“OCA\Files_Versions\Storage”,“type”:"::"},{“file”:"/var/www/html/nextcloud/lib/private/Command/CommandJob.php",“line”:35,“function”:“handle”,“class”:“OCA\Files_Versions\Command\Expire”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/BackgroundJob/Job.php",“line”:62,“function”:“run”,“class”:“OC\Command\CommandJob”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/BackgroundJob/QueuedJob.php",“line”:46,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:"->"},{“file”:"/var/www/html/nextcloud/cron.php",“line”:148,“function”:“execute”,“class”:“OC\BackgroundJob\QueuedJob”,“type”:"->"}],“File”:"/var/www/html/nextcloud/lib/private/Files/Storage/FailedStorage.php",“Line”:210,“Hint”:“Storage is temporarily not available”,“Previous”:{“Exception”:“OCP\Files\StorageNotAvailableException”,“Message”:“Storage with mount id 6 is not available”,“Code”:1,“Trace”:[{“function”:“OCA\Files_External\Config\{closure}”,“class”:“OCA\Files_External\Config\ConfigAdapter”,“type”:"->",“args”:["*** sensitive parameters replaced ***"]},{“file”:"/var/www/html/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",“line”:146,“function”:“array_map”},{“file”:"/var/www/html/nextcloud/lib/private/Files/Config/MountProviderCollection.php",“line”:105,“function”:“getMountsForUser”,“class”:“OCA\Files_External\Config\ConfigAdapter”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Filesystem.php",“line”:447,“function”:“addMountForUser”,“class”:“OC\Files\Config\MountProviderCollection”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/Files/Filesystem.php",“line”:376,“function”:“initMountPoints”,“class”:“OC\Files\Filesystem”,“type”:"::"},{“file”:"/var/www/html/nextcloud/lib/private/legacy/OC_Util.php",“line”:308,“function”:“init”,“class”:“OC\Files\Filesystem”,“type”:"::"},{“file”:"/var/www/html/nextcloud/apps/files_versions/lib/Storage.php",“line”:722,“function”:“setupFS”,“class”:“OC_Util”,“type”:"::"},{“file”:"/var/www/html/nextcloud/apps/files_versions/lib/Command/Expire.php",“line”:62,“function”:“expire”,“class”:“OCA\Files_Versions\Storage”,“type”:"::"},{“file”:"/var/www/html/nextcloud/lib/private/Command/CommandJob.php",“line”:35,“function”:“handle”,“class”:“OCA\Files_Versions\Command\Expire”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/BackgroundJob/Job.php",“line”:62,“function”:“run”,“class”:“OC\Command\CommandJob”,“type”:"->"},{“file”:"/var/www/html/nextcloud/lib/private/BackgroundJob/QueuedJob.php",“line”:46,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:"->"},{“file”:"/var/www/html/nextcloud/cron.php",“line”:148,“function”:“execute”,“class”:“OC\BackgroundJob\QueuedJob”,“type”:"->"}],“File”:"/var/www/html/nextcloud/apps/files_external/lib/Config/ConfigAdapter.php",“Line”:151,“Hint”:“Storage is temporarily not available”},“CustomMessage”:“Error while running background job (class: OC\Command\CommandJob, arguments: O:33:“OCA\Files_Versions\Command\Expire”:2:{s:43:”\u0000OCA\Files_Versions\Command\Expire\u0000fileName";s:67:"/Fotos und Videos/DoreasSmartphone/WhatsApp/IMG-20200103-WA0020.jpg";s:39:"\u0000OCA\Files_Versions\Command\Expire\u0000user";s:8:“heimnetz”;})"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0”,“version”:“19.0.0.12”,“id”:“5eee64478b814”}

The output of your config.php file):

<?php $CONFIG = array ( 'instanceid' => 'xxx', 'passwordsalt' => 'xxx', 'secret' => 'xxx', 'trusted_domains' => array ( 0 => 'xxx', ), 'datadirectory' => '/mnt/storage/nextcloud', 'dbtype' => 'mysql', 'version' => '19.0.0.12', 'overwrite.cli.url' => 'xxx', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'xxx', 'dbpassword' => 'xxx', 'installed' => true, 'memcache.distributed' => '\\OC\\Memcache\\APCu', 'memcache.local' => '\\OC\\Memcache\\APCu', 'updater.secret' => 'xxx', 'maintenance' => false, 'theme' => '', 'loglevel' => 2, 'updater.release.channel' => 'beta', 'mysql.utf8mb4' => true, 'app_install_overwrite' => array ( 0 => 'smb_test', ), );

same here, initially upgrade to NC 19 was fine, but happened immediately following php7.4 upgrades, started happening

{"reqId":"KlB0MCrvn8lNKNYTK3Re","level":3,"time":"2020-11-15T01:40:21+00:00","remoteAddr":"10.0.0.52","user":"fermulator","app":"no app in context","method":"PUT","url":"/cloud/index.php/apps/files_external/userglobalstorages/1","message":{"Exception":"Icewind\\SMB\\Exception\\ForbiddenException","Message":"Invalid request for / (ForbiddenException)","Code":1,"Trace":[{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":66,"function":"fromMap","class":"Icewind\\SMB\\Exception\\Exception","type":"::"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":78,"function":"handleError","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php","line":294,"function":"testResult","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":306,"function":"getxattr","class":"Icewind\\SMB\\Native\\NativeState","type":"->"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":64,"function":"getAttribute","class":"Icewind\\SMB\\Native\\NativeShare","type":"->"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php","line":83,"function":"stat","class":"Icewind\\SMB\\Native\\NativeFileInfo","type":"->"},{"file":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php","line":113,"function":"getSize","class":"Icewind\\SMB\\Native\\NativeFileInfo","type":"->"},{"file":"/srv/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":188,"function":"stat","class":"Icewind\\SMB\\Native\\NativeShare","type":"->"},{"file":"/srv/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":336,"function":"getFileInfo","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/srv/nextcloud/lib/private/Files/Storage/Common.php","line":459,"function":"stat","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/srv/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":703,"function":"test","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/srv/nextcloud/apps/files_external/lib/config.php","line":262,"function":"test","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/srv/nextcloud/apps/files_external/lib/Controller/StoragesController.php","line":257,"function":"getBackendStatus","class":"OC_Mount_Config","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/apps/files_external/lib/Controller/UserGlobalStoragesController.php","line":182,"function":"updateStorageStatus","class":"OCA\\Files_External\\Controller\\StoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"update","class":"OCA\\Files_External\\Controller\\UserGlobalStoragesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/srv/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/srv/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/srv/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/srv/nextcloud/lib/base.php","line":1011,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/srv/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/srv/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Exception/Exception.php","Line":30,"CustomMessage":"Error while getting file info"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0","version":"19.0.4.2","id":"5fb087067d8d2"}

EDIT: WORKAROUND/FIX: added “local” for domain in all existing external SMB