Paperless-NGX issue with services starting #367

Closed
opened 2026-02-04 18:15:03 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @beercity on GitHub (Jan 22, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Paperless-NGX

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/paperless-ngx.sh)"

📝 Provide a clear and concise description of the issue.

When installing Paperless-NGX using the script, it appears that there is not enough time for the database to come up before the Paperless services start, and the services fail to start.
This impacts both the paperless-consumer.service and paperless-scheduler.service

I was able to resolve this by adding a 2 second wait to the systemd for both services.

I tested this with an install of Paperless-NGX from their documented steps for a bare-metal install, and did not have this issue with services failing to start

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

Install using default settings

Reboot the LXC container

Run systemctl and observe services that have failed to start

Paste the full error output (if available).

`root@paperless-lxc:~# systemctl status paperless-consumer.service
× paperless-consumer.service - Paperless consumer
Loaded: loaded (/etc/systemd/system/paperless-consumer.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2025-01-22 13:44:50 EST; 2min 6s ago
Duration: 1.161s
Process: 103 ExecStart=python3 manage.py document_consumer (code=exited, status=1/FAILURE)
Main PID: 103 (code=exited, status=1/FAILURE)
CPU: 1.077s

Jan 22 13:44:50 paperless-lxc python3[103]: File "/usr/local/lib/python3.11/dist-packages/django/db/backends/postgresql/base.py", line 332, in get_new_connection
Jan 22 13:44:50 paperless-lxc python3[103]: connection = self.Database.connect(**conn_params)
Jan 22 13:44:50 paperless-lxc python3[103]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 22 13:44:50 paperless-lxc python3[103]: File "/usr/local/lib/python3.11/dist-packages/psycopg/connection.py", line 119, in connect
Jan 22 13:44:50 paperless-lxc python3[103]: raise last_ex.with_traceback(None)
Jan 22 13:44:50 paperless-lxc python3[103]: django.db.utils.OperationalError: connection is bad: connection to server at "::1", port 5432 failed: Cannot assign requested address
Jan 22 13:44:50 paperless-lxc python3[103]: Is the server running on that host and accepting TCP/IP connections?
Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Main process exited, code=exited, status=1/FAILURE
Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Failed with result 'exit-code'.
Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Consumed 1.077s CPU time.`

🖼️ Additional context (optional).

Example systemd file

`[Unit]
Description=Paperless consumer
Requires=redis.service

[Service]
WorkingDirectory=/opt/paperless/src
ExecStartPre=/bin/sleep 2
ExecStart=python3 manage.py document_consumer

[Install]
WantedBy=multi-user.target`

Originally created by @beercity on GitHub (Jan 22, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Paperless-NGX ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/paperless-ngx.sh)" ### 📝 Provide a clear and concise description of the issue. When installing Paperless-NGX using the script, it appears that there is not enough time for the database to come up before the Paperless services start, and the services fail to start. This impacts both the paperless-consumer.service and paperless-scheduler.service I was able to resolve this by adding a 2 second wait to the systemd for both services. I tested this with an install of Paperless-NGX from their documented steps for a bare-metal install, and did not have this issue with services failing to start ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. Install using default settings Reboot the LXC container Run systemctl and observe services that have failed to start ### ❌ Paste the full error output (if available). `root@paperless-lxc:~# systemctl status paperless-consumer.service × paperless-consumer.service - Paperless consumer Loaded: loaded (/etc/systemd/system/paperless-consumer.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Wed 2025-01-22 13:44:50 EST; 2min 6s ago Duration: 1.161s Process: 103 ExecStart=python3 manage.py document_consumer (code=exited, status=1/FAILURE) Main PID: 103 (code=exited, status=1/FAILURE) CPU: 1.077s Jan 22 13:44:50 paperless-lxc python3[103]: File "/usr/local/lib/python3.11/dist-packages/django/db/backends/postgresql/base.py", line 332, in get_new_connection Jan 22 13:44:50 paperless-lxc python3[103]: connection = self.Database.connect(**conn_params) Jan 22 13:44:50 paperless-lxc python3[103]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Jan 22 13:44:50 paperless-lxc python3[103]: File "/usr/local/lib/python3.11/dist-packages/psycopg/connection.py", line 119, in connect Jan 22 13:44:50 paperless-lxc python3[103]: raise last_ex.with_traceback(None) Jan 22 13:44:50 paperless-lxc python3[103]: django.db.utils.OperationalError: connection is bad: connection to server at "::1", port 5432 failed: Cannot assign requested address Jan 22 13:44:50 paperless-lxc python3[103]: Is the server running on that host and accepting TCP/IP connections? Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Main process exited, code=exited, status=1/FAILURE Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Failed with result 'exit-code'. Jan 22 13:44:50 paperless-lxc systemd[1]: paperless-consumer.service: Consumed 1.077s CPU time.` ### 🖼️ Additional context (optional). Example systemd file `[Unit] Description=Paperless consumer Requires=redis.service [Service] WorkingDirectory=/opt/paperless/src ExecStartPre=/bin/sleep 2 ExecStart=python3 manage.py document_consumer [Install] WantedBy=multi-user.target`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#367