Open jannislehmann opened 3 years ago
Hello.
This breaks due to some change to the way paperless handles filenames (namely the configuration option PAPERLESS_FILENAME_FORMAT
). The decryption logic was simply not adjusted to respect these changes and there weren't any test cases in place. You will first have to check if your document archive is still in good shape. It might be not. Please check if:
../media/documents/originals/0000328.pdf
)Storage type
of the document in question is set to unencrypted.If any of the above is not true, this either needs to be fixed (which is possible), or you need to recover from a backup.
Paperless-ng still reads encrypted files just fine and the decryption command is verified to work.
Edit. However, there is no warranty. Create a backup before you go this route.
Hey, thanks for the fast answer.
I am not yet using paperless-ng, but the main version (paperless).
However, I just tried out paperless-ng and used this command: https://paperless-ng.readthedocs.io/en/latest/administration.html#disabling-encryption
This sadly fails due to some python dependency missing: ModuleNotFoundError: No module named 'termcolor'
Edit: The files are all still ending with *.pdf.gpg. Thus, the file is still encrypted.
try copying the file 0000328.pdf.gpg out of the media directory, rename it to .pdf, and see if you can open it, since it might have been decrypted in place.
Regarding the issue: Noted. Now I know where that package was used. I'll have that fixed soon.
Alright, great :)
Okay, I did some further testing:
I used a backup, which is entirely encrypted. I created a paperless-ng instance and can download the files. They are missing the file ending. After appending .pdf
to any file, I can open and view it. However, the thumbnails are missing.
I will re-try to decrypt the files using original paperless again. Before I ran the decrypt command, I had 400 files which all ended with .pdf.gpg. After I ran the decrypt command, I have 399 files which end with .pdf.gpg and one file got renamed to .pdf. This is the file 0000328.pdf. This file is openable and the data is still accessible.
Edit 19:41: I just tried a document export which worked out fine for all files.
Okay, hold on. You're actually the first one going this route and I totally forgot to take care of something during the migration process regarding encrypted files.
Uhm, I'd like to address this and will keep you posted.
Importing an export from paperless into the current version of paperless-ng won't work.
Nah, this is not what I am trying to achieve.
I want to shutdown my old instance and decrypt the old files before. Afterwards, I want to start paperless-ng.
I don't want to use an export since this would mean that I will loose all the tags etc.
I think the best way would be to fix up the decryption code in this repository, but I don't know how active the people responsible for merging changes are.
Sorry, for asking again:
Do you know that options I would have with paperless-ng? You do offer a command to decrypt, which seems to be broken because you tried to clean up dependencies. If this would be fixed, I could decrypt the files using paperless-ng? Therefore, I should be able to use paperless-ng already and wait for this fix?
The issue in this repo seems to be: https://github.com/the-paperless-project/paperless/blob/master/src/documents/management/commands/change_storage_type.py#L95
Alright, summary of the issue:
This might take a bit of time.
Alright, thank you a lot for your effort, work and fast answers!
I removed the two lines in question: https://github.com/the-paperless-project/paperless/blob/master/src/documents/management/commands/change_storage_type.py#L95 Afterwards, all files decrypted fine. Now I am able to start paperless-ng and view all files. Lastly, I will have to migrate sqlite to postgres.
Hey,
I was planning on moving to / trying paperless-ng. However, I had to first decrypt my files. Therefore, I created a bash within the
paperless_web
container and executed the following command:./manage.py change_storage_type gpg unencrypted
This resulted in the following log:
All files in the mentioned directory are encrypted and the file
328
gets decrypted after issuing the command. But the script somehow tries to access it afterwards.