document_import in new machine fails with duplicate document error[Support] #13157
-
What's your question or issue?I'm trying to move a paperless-ngx instance from sqlite on Pi 4 to postrges on MacOS. Both instances are running on Docker. The MacOS instance is fresh, but the import fails with "FileExistsError: /usr/src/paperless/media/documents/originals/...". From what I've read this happens when the import encounters the file on disk in the media directory and refuses to copy over it. In my case, media is bound to a newly created, empty directory in a new sparsebundle, so something else is going on. What have you tried?No response Paperless-ngx version2.20.15 Host OSMacOS 26.5.2 Installation methodDocker - official image System statusNo response Relevant logs or output(file path and name contain personal data, so not showing. The original file is an .eml)
Traceback (most recent call last):
File "/usr/src/paperless/src/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/paperless/src/documents/management/commands/document_importer.py", line 247, in handle
self._run_import()
File "/usr/src/paperless/src/documents/management/commands/document_importer.py", line 295, in _run_import
self._import_files_from_manifest()
File "/usr/src/paperless/src/documents/management/commands/document_importer.py", line 390, in _import_files_from_manifest
raise FileExistsError(document.source_path)
FileExistsError: /usr/src/paperless/media/documents/originals/... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The directory must not be empty. Perhaps you partially imported or copied some files manually |
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been automatically closed because it was marked as answered. Please see our contributing guidelines for more details. |
Beta Was this translation helpful? Give feedback.
I got it working. Looking at the original instance on a Pi 4, seems the same document existed twice in the DB, via the email import on different days. I downloaded the original, deleted one record. After that the document could no longer be opened from the remaining record, so I'm guessing that somehow they were pointing to the same artifact in media/
Anyway, after removing the second record and reexporting, I was able to import without error to the new Paperless instance and drag the file in.
I'm not sure how it got messed up, but I may have received the email on two addresses, and the rule was moved from one service to the other, causing it to be processed twice