[GH-ISSUE #189] Import using IMPORTER_DIR throws exception "Papermerge has no users defined" #153

Closed
opened 2026-02-25 21:31:19 +03:00 by kerem · 4 comments
Owner

Originally created by @matthewdavis on GitHub (Oct 23, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/189

Originally assigned to: @ciur on GitHub.

Description
I try to import a file using the IMPORTER_DIR and get the error "Papermerge has no users defined"

I've built the docker images with the following papermerge.config.py

DBUSER = "dbuser"
DBPASS = "dbpass"
DBHOST = "db"
DBNAME = "dbname"

MEDIA_DIR = "/opt/media"
STATIC_DIR = "/opt/static"
MEDIA_URL = "/media/"
STATIC_URL = "/static/"
IMPORTER_DIR = "/import"

OCR_DEFAULT_LANGUAGE = "eng"

OCR_LANGUAGES = {
"deu": "Deutsch",
"spa": "Español",
"eng": "English",
"fra": "Français",
"rus": "Русский",
"ron": "Română"
}

When I place a file in the docker mounted /import directory, a short time later the worker wakes up and attempts to import the file. Below are the logs from the worker

papermerge_worker | [2020-10-23 01:04:53,677: INFO/Beat] Scheduler: Sending due task import_from_local_folder (papermerge.core.management.commands.worker.import_from_local_folder)
papermerge_worker | [2020-10-23 01:04:53,732: INFO/MainProcess] Received task: papermerge.core.management.commands.worker.import_from_local_folder[6277026b-a44b-4d61-94d5-5349ce8f9f74]
papermerge_worker | [2020-10-23 01:04:53,734: DEBUG/ForkPoolWorker-2] Celery beat: import_from_local_folder
papermerge_worker | [2020-10-23 01:04:54,735: INFO/ForkPoolWorker-2] Importing file /import/Consent for Treatment_Signature.pdf...
papermerge_worker | [2020-10-23 01:04:54,738: INFO/ForkPoolWorker-2] Same as temp_file_name=/tmp/tmpj_ghk0b1/Consent for Treatment_Signature.pdf...
papermerge_worker | [2020-10-23 01:04:54,761: ERROR/ForkPoolWorker-2] Task papermerge.core.management.commands.worker.import_from_local_folder[6277026b-a44b-4d61-94d5-5349ce8f9f74] raised unexpected: Exception('Papermerge has no users d
efined')
papermerge_worker | Traceback (most recent call last):
papermerge_worker | File "/opt/app/.venv/lib/python3.8/site-packages/celery/app/trace.py", line 385, in trace_task
papermerge_worker | R = retval = fun(*args, **kwargs)
papermerge_worker | File "/opt/app/.venv/lib/python3.8/site-packages/celery/app/trace.py", line 650, in protected_call
papermerge_worker | return self.run(*args, **kwargs)
papermerge_worker | File "/opt/app/papermerge/core/management/commands/worker.py", line 53, in import_from_local_folder
papermerge_worker | import_documents(settings.PAPERMERGE_IMPORTER_DIR)
papermerge_worker | File "/opt/app/papermerge/core/importers/local.py", line 44, in import_documents
papermerge_worker | imp = DocumentImporter(temp_file_name)
papermerge_worker | File "/opt/app/papermerge/core/document_importer.py", line 36, in init
papermerge_worker | raise Exception("Papermerge has no users defined")
papermerge_worker | Exception: Papermerge has no users defined

Expected
I expect the file to be imported.

Actual
It seems the file gets "imported" into a ghost area and disappears / deletes

Info:

  • OS: Fedora 32 host os / moby-engine-19.03.11-1.ce.git42e35e6.fc32.x86_64
  • Browser - Firefox 81.0.2
  • Database PostgreSQL 12.3
  • Papermerge Version 1.5.0

I'm using the docker-compose included in git with modifications only to use local dirs instead of volumes.

Originally created by @matthewdavis on GitHub (Oct 23, 2020). Original GitHub issue: https://github.com/ciur/papermerge/issues/189 Originally assigned to: @ciur on GitHub. **Description** I try to import a file using the IMPORTER_DIR and get the error "Papermerge has no users defined" I've built the docker images with the following papermerge.config.py >DBUSER = "dbuser" DBPASS = "dbpass" DBHOST = "db" DBNAME = "dbname" >MEDIA_DIR = "/opt/media" STATIC_DIR = "/opt/static" MEDIA_URL = "/media/" STATIC_URL = "/static/" IMPORTER_DIR = "/import" >OCR_DEFAULT_LANGUAGE = "eng" >OCR_LANGUAGES = { "deu": "Deutsch", "spa": "Español", "eng": "English", "fra": "Français", "rus": "Русский", "ron": "Română" } When I place a file in the docker mounted /import directory, a short time later the worker wakes up and attempts to import the file. Below are the logs from the worker >papermerge_worker | [2020-10-23 01:04:53,677: INFO/Beat] Scheduler: Sending due task import_from_local_folder (papermerge.core.management.commands.worker.import_from_local_folder) papermerge_worker | [2020-10-23 01:04:53,732: INFO/MainProcess] Received task: papermerge.core.management.commands.worker.import_from_local_folder[6277026b-a44b-4d61-94d5-5349ce8f9f74] papermerge_worker | [2020-10-23 01:04:53,734: DEBUG/ForkPoolWorker-2] Celery beat: import_from_local_folder papermerge_worker | [2020-10-23 01:04:54,735: INFO/ForkPoolWorker-2] Importing file /import/Consent for Treatment_Signature.pdf... papermerge_worker | [2020-10-23 01:04:54,738: INFO/ForkPoolWorker-2] Same as temp_file_name=/tmp/tmpj_ghk0b1/Consent for Treatment_Signature.pdf... papermerge_worker | [2020-10-23 01:04:54,761: ERROR/ForkPoolWorker-2] Task papermerge.core.management.commands.worker.import_from_local_folder[6277026b-a44b-4d61-94d5-5349ce8f9f74] raised unexpected: Exception('Papermerge has no users d efined') papermerge_worker | Traceback (most recent call last): papermerge_worker | File "/opt/app/.venv/lib/python3.8/site-packages/celery/app/trace.py", line 385, in trace_task papermerge_worker | R = retval = fun(*args, **kwargs) papermerge_worker | File "/opt/app/.venv/lib/python3.8/site-packages/celery/app/trace.py", line 650, in __protected_call__ papermerge_worker | return self.run(*args, **kwargs) papermerge_worker | File "/opt/app/papermerge/core/management/commands/worker.py", line 53, in import_from_local_folder papermerge_worker | import_documents(settings.PAPERMERGE_IMPORTER_DIR) papermerge_worker | File "/opt/app/papermerge/core/importers/local.py", line 44, in import_documents papermerge_worker | imp = DocumentImporter(temp_file_name) papermerge_worker | File "/opt/app/papermerge/core/document_importer.py", line 36, in __init__ papermerge_worker | raise Exception("Papermerge has no users defined") papermerge_worker | Exception: Papermerge has no users defined **Expected** I expect the file to be imported. **Actual** It seems the file gets "imported" into a ghost area and disappears / deletes **Info:** - OS: Fedora 32 host os / moby-engine-19.03.11-1.ce.git42e35e6.fc32.x86_64 - Browser - Firefox 81.0.2 - Database PostgreSQL 12.3 - Papermerge Version 1.5.0 I'm using the docker-compose included in git with modifications only to use local dirs instead of volumes.
kerem 2026-02-25 21:31:19 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ciur commented on GitHub (Oct 23, 2020):

Hi @matthewdavis, thank you for opening this issue.

Can you please confirm that you have a superuser (i.e. Superuser Status is checked)?
Here is an example with screenshot where superuser exists.

Screenshot from 2020-10-23 07-15-57

<!-- gh-comment-id:714918595 --> @ciur commented on GitHub (Oct 23, 2020): Hi @matthewdavis, thank you for opening this issue. Can you please confirm that you have a superuser (i.e. **Superuser Status** is checked)? Here is an example with screenshot where superuser exists. ![Screenshot from 2020-10-23 07-15-57](https://user-images.githubusercontent.com/24827601/96959350-19aec700-1500-11eb-9319-61592c876410.png)
Author
Owner

@matthewdavis commented on GitHub (Oct 23, 2020):

This is a fairly fresh and (hopefully) standard install from the docker container. Did I miss a step to create a user? I'm using the initial admin/admin user. I don't see users/groups on my ui.

image

<!-- gh-comment-id:715474095 --> @matthewdavis commented on GitHub (Oct 23, 2020): This is a fairly fresh and (hopefully) standard install from the docker container. Did I miss a step to create a user? I'm using the initial admin/admin user. I don't see users/groups on my ui. ![image](https://user-images.githubusercontent.com/298426/97034805-fcf0ae80-1554-11eb-98c1-17ff29dc033a.png)
Author
Owner

@maspiter commented on GitHub (Oct 26, 2020):

I got the same error, problem is the admin user is not created thoroughly hence why you don't see the users and groups menu items.

There is something not right with your volumes. Try deleting all data and recreating.

I'm using all three named volumes and overwrite only the 3 config files with custom values.

<!-- gh-comment-id:716872887 --> @maspiter commented on GitHub (Oct 26, 2020): I got the same error, problem is the admin user is not created thoroughly hence why you don't see the users and groups menu items. There is something not right with your volumes. Try deleting all data and recreating. I'm using all three named volumes and overwrite only the 3 config files with custom values.
Author
Owner

@maspiter commented on GitHub (Oct 28, 2020):

Ok, so after much testing and tuning I finally have a working version running.

Regarding the "no users" error. I believe you need to remove or comment the create_user.py line in one of the startup.sh scripts from either the app or the worker. Then the user gets created as it should.

A lot of other things missing in the puzzle though.

<!-- gh-comment-id:718263224 --> @maspiter commented on GitHub (Oct 28, 2020): Ok, so after much testing and tuning I finally have a working version running. Regarding the "no users" error. I believe you need to remove or comment the create_user.py line in one of the startup.sh scripts from either the app or the worker. Then the user gets created as it should. A lot of other things missing in the puzzle though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#153
No description provided.