End-to-End Encryption cannot share encrypted folder. Nextcloud context menu options all greyed out

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

After selecting a folder to be Encrypted in the NC client settings, all the Nextcloud context menu (right click on the encrypted folder) options become greyed out. That is, when you right-click on an encrypted folder in Windows Explorer, the Open in browser, Share options, Copy public link and Copy internal link options of the Nextcloud context menu are greyed out. Before encrypting the folder, all the options are available (not greyed out). That is, once the folder is encrypted, it is not possible to share it anymore ? This is contrary to what https://nextcloud.com/endtoend/ says. Also contrary to this NC youtube: https://www.youtube.com/watch?v=S9_lZtumCmk. Thank you very much

root@mirror:~# snap list nextcloud
Name Version Rev Tracking Publisher Notes
nextcloud 20.0.1snap1 24051 latest/stable nextcloud? -
root@mirror:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
root@mirror:~#

The issue you are facing:

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

Steps to replicate it:

  1. Install Nextcloud snap on Ubuntu server 20
  2. Enable Server Side encryption after installing and enable the Default encryption module on server
  3. Enable Client Side encrytpion on NC desktop client settings after installing and enabling End-to-End encryption module on server
  4. Create empty folder in the Nextcloud folder C:\Users\username\Nextcloud, and on the NC Client settings, designate folder as Encrypted.
  5. Right click on the encrypted folder in C:\Users\username\Nextcloud and go to the Nextcloud context menu. The options Open in browser, Share options, Copy public link and Copy internal link are all greyed out. They weren’t greyed out before the folder was encrypted.

The output of your Nextcloud log in Admin > Logging:

I think these errors are not related to the problem.   I had problem renaming and deleting folder.  Ended up recreating the deleted with the same name.
Level	App	Message		Time
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:25:57-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:22:17-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:20:57-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:15:57-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:13:14-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:12:12-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:11:41-0800
Error	PHP	Error: Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548	
2020-11-17T21:11:11-0800

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

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'instanceid' => 'ocgrbp5jt3cd',
  'passwordsalt' => 'xJghXTJHn+50mJXugFlQf23BD1jcXf',
  'secret' => 'GXzuW3V+nfpbgaYkwMDh2Wk2LeUTcDLS1vXfxBToDw+vXbAC',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'server02.example.com',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.1.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'Ajc3_EXX1R96RAwvG8Vji26EqiJVQVSGg6_ticKdOfv1OgeTw5ygvs2Pq0Al4lsD',
  'installed' => true,
  'mail_from_address' => 'it',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'function.com',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' =>
  array (
    0 => 'txclients',
    1 => 'tx_it',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
    0 => 'grouptx01',
  ),
  'maintenance' => false,
  'encryption.legacy_format_support' => true,
  'encryption.key_storage_migrated' => false,
);

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

 tail -n 40 /var/snap/nextcloud/current/logs/apache_errors.log

[Tue Nov 17 06:48:06.498503 2020] [proxy_fcgi:error] [pid 260383:tid 139659778713344] [client 78.190.133.159:5550] AH01071: Got error 'Primary script unknown'
[Tue Nov 17 15:09:50.513647 2020] [proxy_fcgi:error] [pid 261777:tid 139660072220416] [client 139.59.85.41:36638] AH01071: Got error 'Primary script unknown', referer: http://ka-chunk.com/wp-login.php
[Tue Nov 17 16:41:07.839106 2020] [proxy_fcgi:error] [pid 260383:tid 139659736749824] [client 167.99.78.164:34646] AH01071: Got error 'Primary script unknown', referer: http://ka-chunk.com/wp-login.php
[Tue Nov 17 17:56:16.210876 2020] [proxy_fcgi:error] [pid 260381:tid 139659510277888] [client 134.209.157.198:50464] AH01071: Got error 'Primary script unknown', referer: http://tracker2.function.com/wp-login.php
[Tue Nov 17 19:09:23.746929 2020] [core:error] [pid 260383:tid 139660089005824] [client 193.174.89.19:40772] AH00126: Invalid URI in request 'stager' 'GET stager HTTP/1.1'
[Tue Nov 17 19:09:24.176651 2020] [core:error] [pid 261777:tid 139660097398528] [client 193.174.89.19:43456] AH00126: Invalid URI in request 'stager64' 'GET stager64 HTTP/1.1'


tail -n 40 /var/snap/nextcloud/current/logs/nextcloud.log

ute\\Router","type":"->","args":["/apps/files/ajax/getstoragestats.php"]},{"file":"/snap/nextcloud/24051/htdocs/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/snap/nextcloud/24051/htdocs/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36 OPR/72.0.3815.320","version":"20.0.1.1"}
{"reqId":"wbMUfFkklNJlpkSGWaDr","level":3,"time":"2020-11-18T05:35:57+00:00","remoteAddr":"49.156.37.5","user":"cheemeng","app":"PHP","method":"GET","url":"/index.php/apps/files/ajax/getstoragestats.php?dir=%2F","message":{"Exception":"Error","Message":"Undefined offset: 3 at /snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php#548","Code":0,"Trace":[{"file":"/snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php","line":548,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[8,"Undefined offset: 3","/snap/nextcloud/24051/htdocs/lib/private/legacy/OC_Helper.php",548,{"path":"/","rootInfo":{"__class__":"OC\\Files\\FileInfo"},"includeExtStorage":false,"used":18380553,"quota":-3,"mount":{"__class__":"OC\\Files\\Mount\\MountPoint"},"storage":{"cache":null,"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"sourceStorage":{"cache":null,"scanner":{"__class__":"OC\\Files\\Cache\\Scanner"},"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\Files_Trashbin\\Storage"},"free":450029342720,"total":450047723273,"relative":0,"ownerId":"cheemeng","ownerDisplayName":"cheemeng","owner":{"__class__":"OC\\User\\User"}}]},{"file":"/snap/nextcloud/24051/htdocs/apps/files/lib/Helper.php","line":51,"function":"getStorageInfo","class":"OC_Helper","type":"::","args":["/"]},{"file":"/snap/nextcloud/24051/htdocs/apps/files/lib/Controller/AjaxController.php","line":47,"function":"buildFileStorageStatistics","class":"OCA\\Files\\Helper","type":"::","args":["/"]},{"file":"/snap/nextcloud/24051/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"getStorageStats","class":"OCA\\Files\\Controller\\AjaxController","type":"->","args":["/"]},{"file":"/snap/nextcloud/24051/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\AjaxController"},"getStorageStats"]},{"file":"/snap/nextcloud/24051/htdocs/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\AjaxController"},"getStorageStats"]},{"file":"/snap/nextcloud/24051/htdocs/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files\\Controller\\AjaxController","getStorageStats",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"action":null,"_route":"files.ajax.getStorageStats"}]},{"file":"/snap/nextcloud/24051/htdocs/lib/base.php","line":1009,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/files/ajax/getstoragestats.php"]},{"file":"/snap/nextcloud/24051/htdocs/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/snap/nextcloud/24051/htdocs/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36 OPR/72.0.3815.320","version":"20.0.1.1"}
root@mirror:/var/snap/nextcloud/current/logrotate#


Update : Resolved. It turns out that I was trying to share an empty encrypted folder and NC doesn’t allow that. After adding a file to the folder, the NC context menu options are available again (not greyed out) and I am able to share the folder.
Thank you.

I spoke too soon. Was able to share the folder (but the other user only sees encrypted files) yesterday as the Nextcloud context menu options became available again (not greyed out) after I added files into the encrypted folder.
But today, the Nextcloud context menu became greyed out again (even after sync-ing)… Looks like e2ee is still beta? Thank you.

So after sharing it the first time, the NextCloud context menu in Windows Explorer becomes greyed-out again and you cannot share with another user.

Also getting “Please wait for the folder to sync before trying to encrypt it” when trying to encrypt a folder.

Hey, did you already solve this? So I´ve been engaging a bit in the theoretial side of things and if I understood correctly, then every time the permissions are changed, the metadatakey changes. And a user can only decrypt the file changes from after when he was added to the allowed users. So this might be the reason why the second user only saw encrypted filed, because they were changed before he/she was added and thereby encrypted with older keys, that the new user has no access to. After changing the file or when adding new files, they should see those.
Please somebody correct me, if I’m wrong.

It’s also explained quite thoroughly in this ccc-talk:
Link to YouTube

Sadly can’t tell you anything about the greyed out options.
Cheers and good luck!

Hi Kelvin

Tried your suggestion of adding changes and new files after the folder was shared. Still did not work. Still seeing multiple encrypted files in the share encrypted folde.r

The End to End Encryption app got only 1 star rating. Must be some reason for it.
Maybe it is because we have Server Side Encryption enabled?

Disabled Server Side Encryption on the command line but still didn’t work.
In any case, we need Server Side Encryption.

Thank you very much

Hey cmgui,
No worries!
That’s a pity. So do I understand correctly, that there was no single readable folder/file from after changing permissions? Or was the one changed/new file/folder readable and the rest not?
If there was nothing readable, then somebody else will have to help, sorry.

hi Kelvin
Yes, nothing readable. See below.
Thank you very much.

C:\Users\beethoven\Nextcloud6\test_e2ee5>dir
Volume in drive C is Windows
Volume Serial Number is D624-9BD8

Directory of C:\Users\beethoven\Nextcloud6\test_e2ee5

01/16/2021 04:48 AM .
01/16/2021 04:48 AM …
05/06/2015 06:38 AM 381,482 ._dec.~1e1f
05/06/2015 06:38 AM 381,482 ._dec.~1e34
05/23/2018 07:55 AM 983 ._dec.~1f64
05/23/2018 07:55 AM 983 ._dec.~2823
05/06/2015 06:38 AM 381,482 ._dec.~379
05/23/2018 07:55 AM 983 ._dec.~4579
05/06/2015 06:38 AM 381,482 ._dec.~4d5
05/23/2018 07:55 AM 983 ._dec.~4eb5
05/06/2015 06:38 AM 381,482 ._dec.~51cb
05/06/2015 06:38 AM 381,482 ._dec.~58e4
05/23/2018 07:55 AM 983 ._dec.~5f0
05/23/2018 07:55 AM 983 ._dec.~6115
05/06/2015 06:38 AM 381,482 ._dec.~6bc
13 File(s) 2,676,272 bytes
2 Dir(s) 79,002,296,320 bytes free

C:\Users\beethoven\Nextcloud6\test_e2ee5>