paperless-ngx 2.15.0 Installation Error (gunicorn) #784

Closed
opened 2026-02-04 21:31:41 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @KryziK on GitHub (Apr 9, 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 "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)"

📝 Provide a clear and concise description of the issue.

Hello!

First I just want to say I am not well versed in LXC containers and have never used paperless-ngx. I am not 100% sure if the issue lies in paperless-ngx or in the installer script here. See outputs below for information.

I installed paperless-ngx LXC via the command on the website. Installation seemed to go perfectly smoothly.
However, I am unable to connect to the WebUI (generic "connection refused" message in browser). I searched around for the solution but didn't find one. I decided to check the service logs and found that one wasn't running. Outputs are below. I noticed that paperless-ngx was updated yesterday, so I'm thinking maybe there was a change that needs to be addressed in this script?

Command I ran on proxmox host shell:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)"

Installation seems to go just fine:

    ____                        __                                     
   / __ \____ _____  ___  _____/ /__  __________      ____  ____ __  __
  / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/_____/ __ \/ __ `/ |/_/
 / ____/ /_/ / /_/ /  __/ /  / /  __(__  |__  )_____/ / / / /_/ />  <  
/_/    \__,_/ .___/\___/_/  /_/\___/____/____/     /_/ /_/\__, /_/|_|  
           /_/                                           /____/        
  ⚙️  Using Default Settings on node XXX
  🖥️  Operating System: debian
  🌟  Version: 12
  📦  Container Type: Unprivileged
  💾  Disk Size: 10 GB
  🧠  CPU Cores: 2
  🛠️  RAM Size: 2048 MiB
  🆔  Container ID: 103
  🚀  Creating a Paperless-ngx LXC using the above default settings
  
  ✔️  Using local for Template Storage.
  ✔️  Using local-lvm for Container Storage.
  ✔️  Updated LXC Template List
  ✔️  LXC Template is ready to use.
  ✔️  LXC Container 103 was successfully created.
  ✔️   Started LXC Container
  ✔️  Set up Container OS
  ✔️  Network Connected: 192.168.XXX.XXX
  ✔️  IPv4 Internet Connected
  ✖️  IPv6 Internet Not Connected
  ✔️  DNS Resolved github.com to 140.82.113.4
  ✔️  Updated Container OS
  ✔️  Core dependencies installed
  ✔️  Installed Dependencies
  ✔️  Setup Python3
  ✔️  Installed OCR Dependencies
  ✔️  Installed JBIG2
  ✔️  Installed Paperless-ngx
  ✔️  Installed Natural Language Toolkit
  ✔️  Set up PostgreSQL database
Would you like to add Adminer? <y/N> 
  ✔️  Set up admin Paperless-ngx User & Password
  ✔️  Created Services
  ✔️  Customized Container
  ✔️  Cleaned
  ✔️   Completed Successfully!

  🚀  Paperless-ngx setup has been successfully initialized!
  💡   Access it using the following URL:
    🌐  http://192.168.XXX.XXX:8000

Opened a console/shell for the new paperless-ngx container and checked journalctl for paperless-webserver:

Debian GNU/Linux 12 paperless-ngx tty1

paperless-ngx login: 
Debian GNU/Linux 12 paperless-ngx tty1

paperless-ngx login: root (automatic login)


The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Paperless-ngx LXC Container
    🌐   Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE

    🖥️   OS: Debian GNU/Linux - Version: 12
    🏠   Hostname: paperless-ngx
    💡   IP Address: 192.168.XXX.XXX
root@paperless-ngx:~# journalctl -u paperless-webserver.service 
Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed to locate executable /usr/local/bin/gunicorn: No such file or directory
Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed at step EXEC spawning /usr/local/bin/gunicorn: No such file or directory
Apr 09 10:21:43 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver.
Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC
Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'.
root@paperless-ngx:~# 

The error indicates that "gunicorn" was not found. Looking into this, it seems that the paperless-ngx release yesterday is causing this issue:

Feature: Switch webserver to granian @stumpylog (https://github.com/paperless-ngx/paperless-ngx/pull/9218)
https://github.com/paperless-ngx/paperless-ngx/pull/9218/files

Is this a problem with this installer script not correctly addressing requirements, or am I in the wrong place and is this a bug in paperless-ngx itself?

Thanks for your time!

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

  1. Run script command on proxmox host shell (no existing paperless-ngx install on my host).
  2. Wait for installation to complete (answer N to Adminer).
  3. Try to browse to the paperless-ngx WebUI URL (on port 8000).
  4. Page does not load.

Paste the full error output (if available).

root@paperless-ngx:~# journalctl -u paperless-webserver.service 
Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed to locate executable /usr/local/bin/gunicorn: No such file or directory
Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed at step EXEC spawning /usr/local/bin/gunicorn: No such file or directory
Apr 09 10:21:43 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver.
Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC
Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'.

🖼️ Additional context (optional).

No response

Originally created by @KryziK on GitHub (Apr 9, 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 "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)" ### 📝 Provide a clear and concise description of the issue. Hello! First I just want to say I am not well versed in LXC containers and have never used paperless-ngx. I am not 100% sure if the issue lies in paperless-ngx or in the installer script here. See outputs below for information. I installed paperless-ngx LXC via the command on the website. Installation seemed to go perfectly smoothly. However, I am unable to connect to the WebUI (generic "connection refused" message in browser). I searched around for the solution but didn't find one. I decided to check the service logs and found that one wasn't running. Outputs are below. I noticed that paperless-ngx was updated yesterday, so I'm thinking maybe there was a change that needs to be addressed in this script? Command I ran on proxmox host shell: ``` bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/paperless-ngx.sh)" ``` Installation seems to go just fine: ``` ____ __ / __ \____ _____ ___ _____/ /__ __________ ____ ____ __ __ / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/_____/ __ \/ __ `/ |/_/ / ____/ /_/ / /_/ / __/ / / / __(__ |__ )_____/ / / / /_/ /> < /_/ \__,_/ .___/\___/_/ /_/\___/____/____/ /_/ /_/\__, /_/|_| /_/ /____/ ⚙️ Using Default Settings on node XXX 🖥️ Operating System: debian 🌟 Version: 12 📦 Container Type: Unprivileged 💾 Disk Size: 10 GB 🧠 CPU Cores: 2 🛠️ RAM Size: 2048 MiB 🆔 Container ID: 103 🚀 Creating a Paperless-ngx LXC using the above default settings ✔️ Using local for Template Storage. ✔️ Using local-lvm for Container Storage. ✔️ Updated LXC Template List ✔️ LXC Template is ready to use. ✔️ LXC Container 103 was successfully created. ✔️ Started LXC Container ✔️ Set up Container OS ✔️ Network Connected: 192.168.XXX.XXX ✔️ IPv4 Internet Connected ✖️ IPv6 Internet Not Connected ✔️ DNS Resolved github.com to 140.82.113.4 ✔️ Updated Container OS ✔️ Core dependencies installed ✔️ Installed Dependencies ✔️ Setup Python3 ✔️ Installed OCR Dependencies ✔️ Installed JBIG2 ✔️ Installed Paperless-ngx ✔️ Installed Natural Language Toolkit ✔️ Set up PostgreSQL database Would you like to add Adminer? <y/N> ✔️ Set up admin Paperless-ngx User & Password ✔️ Created Services ✔️ Customized Container ✔️ Cleaned ✔️ Completed Successfully! 🚀 Paperless-ngx setup has been successfully initialized! 💡 Access it using the following URL: 🌐 http://192.168.XXX.XXX:8000 ``` Opened a console/shell for the new paperless-ngx container and checked journalctl for paperless-webserver: ``` Debian GNU/Linux 12 paperless-ngx tty1 paperless-ngx login: Debian GNU/Linux 12 paperless-ngx tty1 paperless-ngx login: root (automatic login) The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Paperless-ngx LXC Container 🌐 Provided by: community-scripts ORG | GitHub: https://github.com/community-scripts/ProxmoxVE 🖥️ OS: Debian GNU/Linux - Version: 12 🏠 Hostname: paperless-ngx 💡 IP Address: 192.168.XXX.XXX root@paperless-ngx:~# journalctl -u paperless-webserver.service Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed to locate executable /usr/local/bin/gunicorn: No such file or directory Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed at step EXEC spawning /usr/local/bin/gunicorn: No such file or directory Apr 09 10:21:43 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver. Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'. root@paperless-ngx:~# ``` The error indicates that "gunicorn" was not found. Looking into this, it seems that the paperless-ngx release yesterday is causing this issue: ``` Feature: Switch webserver to granian @stumpylog (https://github.com/paperless-ngx/paperless-ngx/pull/9218) https://github.com/paperless-ngx/paperless-ngx/pull/9218/files ``` Is this a problem with this installer script not correctly addressing requirements, or am I in the wrong place and is this a bug in paperless-ngx itself? Thanks for your time! ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. 1. Run script command on proxmox host shell (no existing paperless-ngx install on my host). 2. Wait for installation to complete (answer N to Adminer). 3. Try to browse to the paperless-ngx WebUI URL (on port 8000). 4. Page does not load. ### ❌ Paste the full error output (if available). ``` root@paperless-ngx:~# journalctl -u paperless-webserver.service Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed to locate executable /usr/local/bin/gunicorn: No such file or directory Apr 09 10:21:43 paperless-ngx (gunicorn)[35064]: paperless-webserver.service: Failed at step EXEC spawning /usr/local/bin/gunicorn: No such file or directory Apr 09 10:21:43 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver. Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC Apr 09 10:21:43 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'. ``` ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bug label 2026-02-04 21:31:41 +03:00
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

strange, have this script build yesterday after the release and it works smoothly. i check it tomorrow

@MickLesk commented on GitHub (Apr 9, 2025): strange, have this script build yesterday after the release and it works smoothly. i check it tomorrow
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

found the solution. i prepare an pr.

@MickLesk commented on GitHub (Apr 9, 2025): found the solution. i prepare an pr.
Author
Owner

@KryziK commented on GitHub (Apr 9, 2025):

Thanks for looking at this so quickly!

Is there any reason not to have the installer script use the .service scripts directly from paperless-ngx download?

@KryziK commented on GitHub (Apr 9, 2025): Thanks for looking at this so quickly! Is there any reason not to have the installer script use the .service scripts directly from paperless-ngx download?
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

Yes, relatively simple, they didn't exist when the script was built :D

It would need a rework at some point, but I'm waiting for debian 13 (because of the Ghostscript stuff).

Build now, work fine. Can you check?

@MickLesk commented on GitHub (Apr 9, 2025): Yes, relatively simple, they didn't exist when the script was built :D It would need a rework at some point, but I'm waiting for debian 13 (because of the Ghostscript stuff). Build now, work fine. Can you check?
Author
Owner

@KryziK commented on GitHub (Apr 9, 2025):

Tried it and it still didn't work for me on a brand new LXC. I had to copy paste the Exec line (multiple lines) from the paperless-ngx repo for it to work.

Progress, at least!

I'm on my phone right now so I can't paste my final service file, but I will in an hour or two.

@KryziK commented on GitHub (Apr 9, 2025): Tried it and it still didn't work for me on a brand new LXC. I had to copy paste the Exec line (multiple lines) from the paperless-ngx repo for it to work. Progress, at least! I'm on my phone right now so I can't paste my final service file, but I will in an hour or two.
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

Alright. That's enough for me for today ^^ End of work.

@MickLesk commented on GitHub (Apr 9, 2025): Alright. That's enough for me for today ^^ End of work.
Author
Owner

@KryziK commented on GitHub (Apr 9, 2025):

Just an update, my final paperless-webserver.service file looks like:

[Unit]
Description=Paperless webserver
After=network.target
Wants=network.target
Requires=redis.service

[Service]
WorkingDirectory=/opt/paperless/src
Environment=GRANIAN_HOST=::
Environment=GRANIAN_PORT=8000
Environment=GRANIAN_WORKERS=1
ExecStart=/bin/sh -c '\
  # Host: GRANIAN_HOST -> PAPERLESS_BIND_ADDR -> default \
  [ -n "$PAPERLESS_BIND_ADDR" ] && export GRANIAN_HOST=$PAPERLESS_BIND_ADDR; \
  # Port: GRANIAN_PORT -> PAPERLESS_PORT -> default \
  [ -n "$PAPERLESS_PORT" ] && export GRANIAN_PORT=$PAPERLESS_PORT; \
  # Workers: GRANIAN_WORKERS -> PAPERLESS_WEBSERVER_WORKERS -> default \
  [ -n "$PAPERLESS_WEBSERVER_WORKERS" ] && export GRANIAN_WORKERS=$PAPERLESS_WEBSERVER_WORKERS; \
  # URL path prefix: only set if PAPERLESS_FORCE_SCRIPT_NAME exists \
  [ -n "$PAPERLESS_FORCE_SCRIPT_NAME" ] && export GRANIAN_URL_PATH_PREFIX=$PAPERLESS_FORCE_SCRIPT_NAME; \
  exec granian --interface asginl --ws "paperless.asgi:application"'

[Install]
WantedBy=multi-user.target

Both of your PRs did not fix the issue for me.
Also, notice there are some slight changes between paperless-ngx's service file here and the one I manually put together. Namely, these two lines are missing from my file; I don't know if they're needed or not as I've never used paperless-ngx before.

User=paperless
Group=paperless
@KryziK commented on GitHub (Apr 9, 2025): Just an update, my final paperless-webserver.service file looks like: ``` [Unit] Description=Paperless webserver After=network.target Wants=network.target Requires=redis.service [Service] WorkingDirectory=/opt/paperless/src Environment=GRANIAN_HOST=:: Environment=GRANIAN_PORT=8000 Environment=GRANIAN_WORKERS=1 ExecStart=/bin/sh -c '\ # Host: GRANIAN_HOST -> PAPERLESS_BIND_ADDR -> default \ [ -n "$PAPERLESS_BIND_ADDR" ] && export GRANIAN_HOST=$PAPERLESS_BIND_ADDR; \ # Port: GRANIAN_PORT -> PAPERLESS_PORT -> default \ [ -n "$PAPERLESS_PORT" ] && export GRANIAN_PORT=$PAPERLESS_PORT; \ # Workers: GRANIAN_WORKERS -> PAPERLESS_WEBSERVER_WORKERS -> default \ [ -n "$PAPERLESS_WEBSERVER_WORKERS" ] && export GRANIAN_WORKERS=$PAPERLESS_WEBSERVER_WORKERS; \ # URL path prefix: only set if PAPERLESS_FORCE_SCRIPT_NAME exists \ [ -n "$PAPERLESS_FORCE_SCRIPT_NAME" ] && export GRANIAN_URL_PATH_PREFIX=$PAPERLESS_FORCE_SCRIPT_NAME; \ exec granian --interface asginl --ws "paperless.asgi:application"' [Install] WantedBy=multi-user.target ``` Both of your PRs did not fix the issue for me. Also, notice there are some slight changes between paperless-ngx's service file [here](https://github.com/paperless-ngx/paperless-ngx/blob/dev/scripts/paperless-webserver.service) and the one I manually put together. Namely, these two lines are missing from my file; I don't know if they're needed or not as I've never used paperless-ngx before. ``` User=paperless Group=paperless ```
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

And why mine fixes this not? Its exactly the Same in short 😅

@MickLesk commented on GitHub (Apr 9, 2025): And why mine fixes this not? Its exactly the Same in short 😅
Author
Owner

@KryziK commented on GitHub (Apr 9, 2025):

With yours, I got:

Apr 09 12:56:48 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver.
Apr 09 12:56:48 paperless-ngx (=granian)[157]: paperless-webserver.service: Failed to locate executable ExecStart=granian: No such file or directory
Apr 09 12:56:48 paperless-ngx (=granian)[157]: paperless-webserver.service: Failed at step EXEC spawning ExecStart=granian: No such file or directory
Apr 09 12:56:48 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC
Apr 09 12:56:48 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'.

And with the one pasted above, I got:

Apr 09 13:00:54 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver.
Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Starting granian (main PID: 153)
Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Listening at: http://:::8000
Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Spawning worker-1 with PID: 178
Apr 09 13:01:00 paperless-ngx sh[178]: /usr/local/lib/python3.11/dist-packages/django/http/response.py:517: Warning: StreamingHttpResponse must consume synchronous iterators in order to serve them asynchronously. Use an asynch>
Apr 09 13:01:00 paperless-ngx sh[178]:   warnings.warn(
@KryziK commented on GitHub (Apr 9, 2025): With yours, I got: ``` Apr 09 12:56:48 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver. Apr 09 12:56:48 paperless-ngx (=granian)[157]: paperless-webserver.service: Failed to locate executable ExecStart=granian: No such file or directory Apr 09 12:56:48 paperless-ngx (=granian)[157]: paperless-webserver.service: Failed at step EXEC spawning ExecStart=granian: No such file or directory Apr 09 12:56:48 paperless-ngx systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=203/EXEC Apr 09 12:56:48 paperless-ngx systemd[1]: paperless-webserver.service: Failed with result 'exit-code'. ``` And with the one pasted above, I got: ``` Apr 09 13:00:54 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver. Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Starting granian (main PID: 153) Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Listening at: http://:::8000 Apr 09 13:00:54 paperless-ngx sh[153]: [INFO] Spawning worker-1 with PID: 178 Apr 09 13:01:00 paperless-ngx sh[178]: /usr/local/lib/python3.11/dist-packages/django/http/response.py:517: Warning: StreamingHttpResponse must consume synchronous iterators in order to serve them asynchronously. Use an asynch> Apr 09 13:01:00 paperless-ngx sh[178]: warnings.warn( ```
Author
Owner

@MickLesk commented on GitHub (Apr 9, 2025):

Deployed 3 times, all working fine.

Build the Script new Please

@MickLesk commented on GitHub (Apr 9, 2025): Deployed 3 times, all working fine. Build the Script new Please
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#784