Skip to content

Commit 9a30dfb

Browse files
reactor: consolidate encryption troubleshooting into enc. chapter
Signed-off-by: Josh <[email protected]>
1 parent 17b8cf1 commit 9a30dfb

File tree

1 file changed

+4
-52
lines changed

1 file changed

+4
-52
lines changed

admin_manual/issues/general_troubleshooting.rst

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -448,59 +448,11 @@ You can run the following SQL query to reset those after **backing up the databa
448448
449449
UPDATE oc_filecache SET unencrypted_size=0 WHERE encrypted=0;
450450
451-
Troubleshooting downloading or decrypting files
452-
-----------------------------------------------
451+
Troubleshooting encrypted files
452+
-------------------------------
453453

454-
Bad signature error
455-
^^^^^^^^^^^^^^^^^^^
456-
457-
In some rare cases it can happen that encrypted files cannot be downloaded
458-
and return a "500 Internal Server Error". If the Nextcloud log contains an error about
459-
"Bad Signature", then the following command can be used to repair affected files::
460-
461-
occ encryption:fix-encrypted-version userId --path=/path/to/broken/file.txt
462-
463-
Replace "userId" and the path accordingly.
464-
The command will do a test decryption for all files and automatically repair the ones with a signature error.
465-
466-
.. _troubleshooting_encryption_key_not_found:
467-
468-
Encryption key cannot be found
469-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
470-
471-
If the logs contain an error stating that the encryption key cannot be found, you can manually search the data directory for a folder that has the same name as the file name.
472-
For example if a file "example.md" cannot be decrypted, run::
473-
474-
find path/to/datadir -name example.md -type d
475-
476-
Then check the results located in the ``files_encryption`` folder.
477-
If the key folder is in the wrong location, you can move it to the correct folder and try again.
478-
479-
The ``data/files_encryption`` folder contains encryption keys for group folders and system-wide external storages
480-
while ``data/$userid/files_encryption`` contains the keys for specific user storage files.
481-
482-
.. note::
483-
484-
This can happen if encryption was disabled at some point but the :ref:`occ command for decrypt-all<occ_disable_encryption_label>` was not run, and
485-
then someone moved the files to another location. Since encryption was disabled, the keys did not get moved.
486-
487-
Encryption key cannot be found with external storage or group folders
488-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
489-
490-
To resolve this issue, please run the following command::
491-
492-
sudo -E -u www-data php occ encryption:fix-key-location <user-id>
493-
494-
This will attempt to recover keys that were not moved properly.
495-
496-
If this doesn't resolve the problem, please refer to the section :ref:`Encryption key cannot be found<troubleshooting_encryption_key_not_found>` for a manual procedure.
497-
498-
.. note::
499-
500-
There were two known issues where:
501-
502-
- moving files between an encrypted and non-encrypted storage like external storage or group folder `would not move the keys with the files <https://github.com/nextcloud/groupfolders/issues/1896>`_.
503-
- putting files on system-wide external storage would store the keys in the `wrong location <https://github.com/nextcloud/server/pull/32690>`_.
454+
.. tip::
455+
Please also refer to the troubleshooting section in the encryption chapter: :doc:`../configuration_files/encryption_configuration`.
504456

505457
Fair Use Policy
506458
---------------

0 commit comments

Comments
 (0)