Unable to delete files

I have some files that are already deleted on the SMB share, but are still present in the nextcloud index and are shown in the file list. When I try to delete them via the nextcloud web interface, the following error occurs:

Error index Icewind\SMB\Exception\NotFoundException: Invalid request for /Backup/IMG_5290.CR2 (NotFoundException) 2017-01-09T10:25:32+0100


Nextcloud version (eg, 10.0.2): 11.0.0
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 5.6): 7.0.8

The output of your Nextcloud log in Admin > Logging:

Fatal cron An exception occurred while executing ‘UNLOCK TABLES’: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away 2017-01-11T00:00:01+0100
Error PHP Error while sending QUERY packet. PID=5332 at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php#57 2017-01-11T00:00:01+0100
Fatal cron An exception occurred while executing ‘UPDATE oc_jobs SET reserved_at = ‘0’ WHERE id = ?’ with params [“4”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away 2017-01-10T00:00:01+0100
Error PHP Error while sending QUERY packet. PID=8689 at /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php#91 2017-01-10T00:00:01+0100
Error PHP Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath(’/re/files/data/…’) #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile(’/data/Fotos/201…’, 1) #2 [internal function]: OC\Files\View->OC\Files{closure}() #3 /var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806 2017-01-09T17:29:38+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T15:30:02+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T15:30:02+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T15:30:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T15:30:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T15:30:01+0100
Error PHP imagecreatefromstring(): Empty string or invalid image at /var/www/nextcloud/lib/private/legacy/image.php#597 2017-01-09T11:41:48+0100
Error PHP fclose() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/lib/private/Files/Storage/Local.php#218 2017-01-09T11:41:48+0100
Error PHP fread() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/lib/private/Files/Storage/Local.php#217 2017-01-09T11:41:48+0100
Error PHP fopen(/srv/nextcloud/re/files/var/www/nextcloud/core/img/filetypes/audio.svg): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#216 2017-01-09T11:41:48+0100
Error PHP filesize(): stat failed for /srv/nextcloud/re/files/var/www/nextcloud/core/img/filetypes/audio.svg at /var/www/nextcloud/lib/private/Files/Storage/Local.php#211 2017-01-09T11:41:48+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error core Error while running background job (OC\User\NoUserException): Attempted to initialize mount points for null user and no user in session 2017-01-09T11:00:01+0100
Error index Icewind\SMB\Exception\NotFoundException: Invalid request for /Backup/IMG_5290.CR2 (NotFoundException) 2017-01-09T10:25:32+0100
Fatal webdav Icewind\SMB\Exception\NotFoundException: Invalid request for /Backup/IMG_5290.CR2 (NotFoundException) 2017-01-09T10:25:20+0100
Error PHP Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/nextcloud/lib/private/Files/Filesystem.php:806 Stack trace: #0 /var/www/nextcloud/lib/private/Files/View.php(2018): OC\Files\Filesystem::normalizePath(’/re/files/data/…’) #1 /var/www/nextcloud/lib/private/Files/View.php(1156): OC\Files\View->unlockFile(’/data/Fotos/201…’, 1) #2 [internal function]: OC\Files\View->OC\Files{closure}() #3 /var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure)) #4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close() #5 {main} thrown at /var/www/nextcloud/lib/private/Files/Filesystem.php#806 2017-01-09T09:29:20+0100