"all files could be decrypted successfully!" but no file is actually decrypted

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:

Nextcloud version (13.0.5):
Operating system and version (Debian Stretch):
Apache or nginx version (Ngnix 1.10.3):
PHP version (7.0):

The issue you are facing:

I tried to disable server-side encrypt feature and became unable to access my files.

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

Steps to replicate it:

  1. Disabled encrypt app from web admin interface
  2. Disabled server-side encryption via “occ encryption:disable”
  3. Tried to decrypt files via "occ encryption:decrypt-all "
  4. After many hours I get “all files could be decrypted successfully!” but can’t access my files, they seem to be encrypted. This is the log message: “Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.” I’m the owner of the files, they were not shared by another user.

The output of your Nextcloud log in Admin > Logging:

Error	PHP	Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/html/nextcloud.old/lib/private/Files/Filesystem.php:796 Stack trace: #0 /var/www/html/nextcloud.old/lib/private/Files/View.php(2055): OC\Files\Filesystem::normalizePath('/tvaz/files/Sha...') #1 /var/www/html/nextcloud.old/lib/private/Files/View.php(1182): OC\Files\View->unlockFile('/Shared/Vanier/...', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /var/www/html/nextcloud.old/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/html/nextcloud.old/lib/private/Files/Filesystem.php#796	2019-03-13T22:59:17-0400
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.	2019-03-13T22:59:09-0400
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.	2019-03-13T22:59:06-0400
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.	2019-03-13T22:59:03-0400
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.	2019-03-13T22:59:03-0400
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.	2019-03-13T22:59:01-0400
Error	PHP	Uncaught Error: Access to undeclared static property: OC\Files\Filesystem::$normalizedPathCache in /var/www/html/nextcloud.old/lib/private/Files/Filesystem.php:796 Stack trace: #0 /var/www/html/nextcloud.old/lib/private/Files/View.php(2055): OC\Files\Filesystem::normalizePath('/tvaz/files/Sha...') #1 /var/www/html/nextcloud.old/lib/private/Files/View.php(1182): OC\Files\View->unlockFile('/Shared/Vanier/...', 1) #2 [internal function]: OC\Files\View->OC\Files\{closure}() #3 /var/www/html/nextcloud.old/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/html/nextcloud.old/lib/private/Files/Filesystem.php#796	2019-03-13T22:58:58-0400
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.	2019-03-13T22:58:50-0400
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.	2019-03-13T22:58:50-0400
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.

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

<?php
$CONFIG = array (
  'debug' => true,
  'instanceid' => 'XXXXXXXXX',
  'passwordsalt' => 'XXXXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXXXXX',
  'trusted_domains' =>
  array (
    0 => 'XXXXXXXXXX',
  ),
  'datadirectory' => '/var/www/html/nextcloud.old/data',
  'overwrite.cli.url' => 'https://XXXXXXX',
  'dbtype' => 'mysql',
  'version' => '13.0.5.2',
  'dbname' => 'XXXXXXXX',
  'dbhost' => 'XXXXXX',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'XXXXXX',
  'dbpassword' => 'XXXXXXXXX',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);

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

2019/03/14 02:59:03 [error] 4056#4056: *2246 FastCGI sent in stderr: ")
#1 /var/www/html/nextcloud.old/lib/private/Files/View.php(1182): OC\Files\View->unlockFile('/Shared/Vanier/...', 1)
#2 [internal function]: OC\Files\View->OC\Files\{closure}()
#3 /var/www/html/nextcloud.old/3rdparty/icewind/streams/src/CallbackWrapper.php(109): call_user_func(Object(Closure))
#4 [internal function]: Icewind\Streams\CallbackWrapper->stream_close()
#5 {main}
  thrown in /var/www/html/nextcloud.old/lib/private/Files/Filesystem.php on line 796" while reading upstream, client: 172.XXXX, server: XXXXX, request: "GET /remote.php/webdav/Shared/XXXX/Teaching/Java/java_chapter7.pdf HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "XXXXX", referrer: "https://XXXXX/apps/files_pdfviewer/?file=%2Fremote.php%2Fwebdav%2FShared%2FVanier%2FTeaching%2FJava%2Fjava_chapter7.pdf"

Did you ever solve this? I have the same issue with my nextcloud instance :frowning:

The docs are faulty in that they demand you put the nextcloud instance into maintenance mode. If you instead shutdown the webserver (to make sure nobody uses the instance while decrypting) and leave maintenance mode off, the decryption will work. You will, however, need the master recovery password (hope you set one!) and all users will need to have enabled the recovery explicitly. Thanks to some lucky forsight, we had set that manually for every user account we ever created, so we could decrypt all files in a single run.

Hi, thanks for sharing your solution.

I’ve set a master password, and tried everything possible to recover the
files. Then I just recovered an old backup and left some data lost. Not
going to use this encryption feature anytime soon.

Bests,