Gallery app not working if SMB share is present

I’ve discovered that if I have an SMB share configured the the gallery app doesn’t show any pictures from any folders.

I get the following error in the log (last four lines of the log):

Icewind\SMB\Exception\AccessDeniedException: /32bitupgrade/32bit/etc/.nomedia

    /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php - line 85:

    Icewind\SMB\Exception\Exception::fromMap({ NT_STATUS_ ... "}, "NT_STATUS_ACCESS_DENIED", "/32bitupgra ... a")

    /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 416:

    Icewind\SMB\Wrapped\Parser->checkForError([ "NT_STATUS ... "], "/32bitupgra ... a")

    /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php - line 178:

    Icewind\SMB\Wrapped\Share->parseOutput([ "NT_STATUS ... "], "/32bitupgra ... a")

    /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 165:

    Icewind\SMB\Wrapped\Share->stat("/32bitupgra ... a")

I tried creating a gallery.cf with external_shares: no but this doesn’t have any effect.

Nextcloud version: 15.0.14
Operating system and version: Debian 9.11,
PHP version: 7.033

Just upgraded to 17.0.3 and have the same issue.

OK figured it out. I had a directory in my SMB share which was only readable by root. Once I fixed this the gallery app worked fine.

I would’ve expected more graceful handling though.