#714·paperless

Disabling encryption failing after one file

Author: jannislehmannCreated Dec 16, 2020Updated Dec 16, 2020

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:

b'Decrypting 20180801000000: 0219CFB2B927132B00841159778E1401'
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/usr/src/paperless/src/documents/management/commands/change_storage_type.py", line 66, in handle
    self.__gpg_to_unencrypted(passphrase)
  File "/usr/src/paperless/src/documents/management/commands/change_storage_type.py", line 96, in __gpg_to_unencrypted
    os.unlink(path)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/paperless/src/../media/documents/originals/0000328.pdf.gpg'

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.

Source: the-paperless-project/paperless