Exception: Can not decrypt this file

I created a group of some users and I had shared folders with this group. And all works fine until the upgrade from Owncloud 10.0.8 to 10.0.10 and all Windows client to the last version.

After the upgrade, all clients doesn’t sync a lot of shared file cause to the error:

Exception: Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.

We have removed the share with the user and re-create it with the same result. The group’ users has problem with different files.
I noticed that during the re-sharing, Owncloud recreate all users sharedKeys for all the shared files, not only the key for the single user.
Is there a way to solve this problem?


Hi, were the files encrypted with user key oder master key encrpytion?

Do the problematic files have something in common or are those files of all types, size and belong to different users?

The files are encrypted with a master key and the problematic files are different in size and type but belong from the same user. The user share a lot of files and folders with a group of users and some of them has the problem with different folders and files.

Other files raise

Exception: Bad Signature

If I run the following command I receive the same error:

su apache -c “php ./occ files:checksums:verify -v -u Giotto”

PHP Warning:  Module 'memcache' already loaded in Unknown on line 0
Skipping Giotto/documents/d32ac96be44cdf612e05f9538197562fc588095f.odt => No Checksum
Skipping Giotto/files/Documents/Example.odt => No Checksum
Checking Giotto/files/Giotto-Utilità/Ardena/CDA_Ardena-Giotto Biotech_Two_Way_v1_24 May 2018(1).docx => SHA1:27685d0cba6814417470e4ac380fea5905ad75cc MD5:76c8491a3a56e8121f5d3855f4412e03 ADLER32:87b3beca

In Encryption.php line 366:
  Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.  

Exception trace:
 OCA\Encryption\Crypto\Encryption->decrypt() at /var/www/html/lib/private/Files/Stream/Encryption.php:454
 OC\Files\Stream\Encryption->readCache() at /var/www/html/lib/private/Files/Stream/Encryption.php:289
 OC\Files\Stream\Encryption->stream_read() at n/a:n/a
 hash_update_stream() at /var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php:862
 OC\Files\Storage\Wrapper\Encryption->hash() at /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php:317
 OC\Files\Storage\Wrapper\Wrapper->hash() at /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php:317
 OC\Files\Storage\Wrapper\Wrapper->hash() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:216
 OCA\Files\Command\VerifyChecksums::calculateActualChecksums() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:122
 OCA\Files\Command\VerifyChecksums->OCA\Files\Command\{closure}() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:176
 OCA\Files\Command\VerifyChecksums->walkNodes() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:174
 OCA\Files\Command\VerifyChecksums->walkNodes() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:174
 OCA\Files\Command\VerifyChecksums->walkNodes() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:174
 OCA\Files\Command\VerifyChecksums->walkNodes() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:140
 OCA\Files\Command\VerifyChecksums->OCA\Files\Command\{closure}() at /var/www/html/apps/files/lib/Command/VerifyChecksums.php:144
 OCA\Files\Command\VerifyChecksums->execute() at /var/www/html/lib/composer/symfony/console/Command/Command.php:251
 Symfony\Component\Console\Command\Command->run() at /var/www/html/lib/composer/symfony/console/Application.php:946
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/lib/composer/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /var/www/html/lib/composer/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:161
 OC\Console\Application->run() at /var/www/html/console.php:106
 require_once() at /var/www/html/occ:11

If I remove the file checksum from DB, the command goes to the next file and stops with the same error on a different file.

Can you try occ files:scan --all? This command removes all the checksums

I did, the command ends without error. But when I try to rerun files:checksums:verify some files has the same problem. I’ve to remove the checksum manually from DB.

Have you tried decrypting your files?

I’ve a lot of files synced by some user. To decrypt all files I need a lot of time and the users cannot work. So, do you think this solve the problem?

Now after removed manually some checksum, files:scan and files:checksums:verify ends without error.
I’m checking what happen on the client.

I think your problem is that something went wrong during the upgrade. Now oC can not read some encrypted files. One solution would be to try to decrypt them. The other solution would be to restore ( if you have one ) a backup.

Then, now seems that all Exception: Can not decrypt this file errors are disappeared on all client.
The only error on some files is Bad signature, what’s means? Is there a way to solve also this problem?
Thank you

Does this error prevent you from syncing?

Can you tell me how you upgraded your server?

Yes the error prevent the syncing.

I upgraded manually. I removed the old installation, unzipped the new version and copied the config.php from the old to the new.

Do you have a backup?

Backup of what, old installation or user data?
Yes for the previous version, no for user data that resides in an external disk box.

Okay. So as far as I can understand most of your files don’t have errors and are synced normally.

The ones where you get the errors are either lost or we could look in the database for clues. the oc_filecache table ist the interesting one.

Thanks, what I’ve to check in oc_filecache for these files?

I don’t understand. This morning if I run again files:checksums:verify I receive again the Exception: Can not decrypt this file on some files. Why?