Unable to delete files from folders that are not E2E encrypted

Unable to delete files from an unencrypted (E2E) folder

I can’t delete files that are uploaded to a non E2E encrypted folder it seems.

Nextcloud version: 24.0.6.1
Operating system and version: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1021-oracle aarch64)
PHP version : Version: 8.0.25, Memory limit: 512 MB, Max execution time: 3600,Upload max size: 100 MB
Apache versoin: Apache/2.4.54 (Ubuntu)
Nginx version: nginx/1.23.2

I am unable to delete files only from a folder that is non E2E encrypted. I can replicate the issue every single time.

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

Steps to replicate it:

  1. Upload a file to a folder that is not E2E encrypted. In my case Photos or at the top level (not under any subfolder)
  2. After the file has been uploaded, try to delete the uploaded file
  3. Error message as per below

The output of your Nextcloud log in Admin > Logging:

[webdav] Fatal: OCA\DAV\Connector\Sabre\Exception\Forbidden: Write access to end-to-end encrypted folder requires token - no token sent at <<closure>>

0. /home/nextcloudadmin/web/cloud.example.com/public_html/apps/end_to_end_encryption/lib/Connector/Sabre/LockPlugin.php line 143
   OCA\EndToEndEncryption\Connector\Sabre\LockPlugin->verifyTokenOnWriteAccess()
1. /home/nextcloudadmin/web/cloud.example.com/public_html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
   OCA\EndToEndEncryption\Connector\Sabre\LockPlugin->checkLock()
2. /home/nextcloudadmin/web/cloud.example.com/public_html/3rdparty/sabre/dav/lib/DAV/Server.php line 456
   Sabre\DAV\Server->emit()
3. /home/nextcloudadmin/web/cloud.example.com/public_html/3rdparty/sabre/dav/lib/DAV/Server.php line 253
   Sabre\DAV\Server->invokeMethod()
4. /home/nextcloudadmin/web/cloud.example.com/public_html/3rdparty/sabre/dav/lib/DAV/Server.php line 321
   Sabre\DAV\Server->start()
5. /home/nextcloudadmin/web/cloud.example.com/public_html/apps/dav/lib/Server.php line 358
   Sabre\DAV\Server->exec()
6. /home/nextcloudadmin/web/cloud.example.com/public_html/apps/dav/appinfo/v2/remote.php line 35
   OCA\DAV\Server->exec()
7. /home/nextcloudadmin/web/cloud.example.com/public_html/remote.php line 166
   require_once("/home/nextcloudadmin/ ... p")

DELETE /remote.php/dav/files/nextcloud_user/Photos/xcc%20rt5%20djdjd.pdf
from 192.168.XX.X by nextcloud_user at 2022-11-01T02:09:11+00:00

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

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'passwordsalt' => '1222223333333cccc',
  'secret' => '48949vnklfgjfdkljdksfjkldsjfskldfjsdaklfjsadklfjdsaklfsd',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
	  0 => 'OC\\Preview\\Movie',
	  1 => 'OC\\Preview\\PNG',
	  2 => 'OC\\Preview\\JPEG',
	  3 => 'OC\\Preview\\GIF',
	  4 => 'OC\\Preview\\BMP',
	  5 => 'OC\\Preview\\XBitmap',
	  6 => 'OC\\Preview\\MP3',
	  7 => 'OC\\Preview\\MP4',
	  8 => 'OC\\Preview\\TXT',
	  9 => 'OC\\Preview\\MarkDown',
	  10 => 'OC\\Preview\\PDF',
  ),
  'trusted_domains' => 
  array (
    0 => 'localhost',
    2 => 'cloud.example.com',
  ),
  'datadirectory' => '/home/nextcloud_admin/web/cloud.example.com/public_html/data',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud_admin',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud_admin',
  'dbpassword' => '86868686868686868686',
  'installed' => true,
  'instanceid' => '9jcnfhfyr76',
  'default_phone_region' => 'XX',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'maintenance' => false,
);

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.

Same as the stacktrace posted above

My issue looks very similar to: [Bug]: Cannot delete not encrypted files after upgrade from v23 to v24 · Issue #34744 · nextcloud/server · GitHub

In case it helps anyone, I was able to disable server-side encryption to resolve this issue:

1 Like

Awesome, thanks. That solved our problem.

In the GitHub issue linked by you there are some more new comments with details about how to disable the server side encryption.