Internal Server error when deleting files

Internal server error when deleting a file

After updating 20.0.8 to 20.0.9 Im getting an internal server error when I try to delete files, this error stays for like 1 second, after that the error disappears and the files do get deleted (to the trash bin). If I look into the logs it says it cannot access encryption module, except im not using this anymore.

It only shows when deleting single files, if i remove an folder with files included it does not give me an error.

Nextcloud version (eg, 20.0.5): 20.0.9
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.19.6
PHP version (eg, 7.4): 7.4

The issue you are facing:

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

Steps to replicate it:

  1. Make a new file, upload it
  2. Just press delete, it will immediatly give an internal server error
  3. After 1s, errors disappears and the file is deleted to the trash bin

The output of your Nextcloud log in Admin > Logging:

Error	no app in context	Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.	
2021-04-20T11:52:17+0200
Fatal	webdav	Error: Call to a member function getId() on array	
2021-04-20T11:52:03+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#439	
2021-04-20T11:52:03+0200
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 3904519 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 229376 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.	
2021-04-20T11:51:17+0200
Fatal	webdav	OC\Encryption\Exceptions\DecryptionFailedException: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.	
2021-04-20T11:51:17+0200
Error	no app in context	Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.	
2021-04-20T11:51:17+0200
Fatal	webdav	OC\Encryption\Exceptions\DecryptionFailedException: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.	
2021-04-20T11:51:17+0200
Error	no app in context	Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.	
2021-04-20T11:51:17+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#439	
2021-04-20T11:50:49+0200
Fatal	webdav	Error: Call to a member function getId() on array	
2021-04-20T11:50:42+0200
Error	PHP	Error: Trying to access array offset on value of type bool at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#439

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

{"reqId":"Cf87GlVfpHAFVGfU7OMv","level":3,"time":"2021-04-20T09:50:42+00:00","remoteAddr":"172.16.20.254","user":"test","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/test/IMG_3281.jpg","message":{"Exception":"Error","Message":"Trying to access array offset on value of type bool at /var/www/nextcloud/l
ib/private/Files/Storage/Wrapper/Encryption.php#439","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":439,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":300,"function":"fopen","class":"O
C\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":751,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":621,"function":"copyBetweenStorage"
,"class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":240,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":322,"function":"moveFromStorage","cl
ass":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":108,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":103,"function":"moveToTrash","class":"O
CA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":203,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Storage.php","line":103,"function":"doDelete","class":"OCA\\File
s_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1167,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":724,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/
dav/lib/Connector/Sabre/File.php","line":466,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":183,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":295,"fu
nction":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server",
"type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Se
rver.php","line":332,"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":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_
once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)","version":"20.0.9.1"}
{"reqId":"Cf87GlVfpHAFVGfU7OMv","level":4,"time":"2021-04-20T09:50:42+00:00","remoteAddr":"172.16.20.254","user":"test","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/test/IMG_3281.jpg","message":{"Exception":"Error","Message":"Call to a member function getId() on array","Code":0,"Trace":[{"file":"/
var/www/nextcloud/lib/private/Files/Cache/Updater.php","line":160,"function":"remove","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":329,"function":"remove","class":"OC\\Files\\Cache\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1179,"fun
ction":"removeUpdate","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":724,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":466,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":183,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":295,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/Wil
dcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMeth
od","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":332,"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":167,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","Line":528,"CustomMessage":"--"},"userAgent
":"Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)","version":"20.0.9.1"}


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

No errors reported

I solved the problem, it seems the default encryption app was loaded… after disabling it the error went away (and i still can read my files :slight_smile: )

In the past (when we where on v17 or v18) we did use server-side encryption and at that time we disabled it and decrypted everything.