tteck / Proxmox

Proxmox VE Helper-Scripts
https://Helper-Scripts.com
MIT License
13.72k stars 2.15k forks source link

paperless-ngx #2348

Closed tikismoke closed 9 months ago

tikismoke commented 9 months ago

Please verify that you have read and understood the guidelines.

yes

A clear and concise description of the issue.

I just create a new blank paperless-ngx container to be sure. Select debian 12,unprivileged.

inside the container seemes gunicorn can't connect to 8000 port:

root@paperless-ngx-new:~# systemctl status paperless-webserver.service
x paperless-webserver.service - Paperless webserver
     Loaded: loaded (/etc/systemd/system/paperless-webserver.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2024-01-16 11:01:31 CET; 59s ago
   Duration: 8.492s
    Process: 14433 ExecStart=/usr/local/bin/gunicorn -c /opt/paperless/gunicorn.conf.py paperless.asgi:application (code=exited, status=1/FAILURE)
   Main PID: 14433 (code=exited, status=1/FAILURE)
        CPU: 1.668s

Jan 16 11:01:26 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:26 +0000] [14433] [INFO] Starting gunicorn 21.2.0
Jan 16 11:01:26 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:26 +0000] [14433] [ERROR] Retrying in 1 second.
Jan 16 11:01:27 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:27 +0000] [14433] [ERROR] Retrying in 1 second.
Jan 16 11:01:28 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:28 +0000] [14433] [ERROR] Retrying in 1 second.
Jan 16 11:01:29 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:29 +0000] [14433] [ERROR] Retrying in 1 second.
Jan 16 11:01:30 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:30 +0000] [14433] [ERROR] Retrying in 1 second.
Jan 16 11:01:31 paperless-ngx-new gunicorn[14433]: [2024-01-16 10:01:31 +0000] [14433] [ERROR] Can't connect to ('::', 8000)
Jan 16 11:01:31 paperless-ngx-new systemd[1]: paperless-webserver.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 11:01:31 paperless-ngx-new systemd[1]: paperless-webserver.service: Failed with result 'exit-code'.
Jan 16 11:01:31 paperless-ngx-new systemd[1]: paperless-webserver.service: Consumed 1.668s CPU time.

Which Linux distribution are you employing?

Debian 12

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

No response

Please provide detailed steps to reproduce the issue.

just fresh install of the script to be sure why my existing install won't work anymore.

tikismoke commented 9 months ago

Same issue selecting debian 11 :(

tikismoke commented 9 months ago

try ubuntu it's worse:


 ✓ Installed Natural Language Toolkit
 - Setting up PostgreSQL database  /CREATE ROLE                                                                                                                                             /CREATE DATABASE                                                                                                                                                                             /Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 382, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 102, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 89, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 217, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/paperless/src/paperless/settings.py", line 100, in <module>
    default: Optional[list[str]] = None,
TypeError: 'type' object is not subscriptable

[ERROR] in line 116: exit code 0: while executing command $STD python3 manage.py migrate
tikismoke commented 9 months ago

OK for debian i find an issue (because i havec disabled ipv6) it need a gunicorn conf file adaptation i think as foring it to the right ip works in gunicorn.conf.py:

#bind = f'{os.getenv("PAPERLESS_BIND_ADDR", "[::]")}:{os.getenv("PAPERLESS_PORT", 8000)}' bind = ['10.0.20.114:8000']

tteck commented 9 months ago

The script runs without any problems from this end.

    ____                        __                                     
   / __ \____ _____  ___  _____/ /__  __________    ____  ____ __  __
  / /_/ / __ `/ __ \/ _ \/ ___/ / _ \/ ___/ ___/___/ __ \/ __ `/ |/_/
 / ____/ /_/ / /_/ /  __/ /  / /  __(__  |__  )___/ / / / /_/ />  <  
/_/    \__,_/ .___/\___/_/  /_/\___/____/____/   /_/ /_/\__, /_/|_|  
           /_/                                         /____/        

Using Advanced Settings
Using Distribution: debian
Using debian Version: 12
Using Container Type: 1
Using Root Password: Automatic Login
Container ID: 111
Using Hostname: paperless-ngx
Using Disk Size: 10
Allocated Cores: 2
Allocated RAM: 2048
Using Bridge: vmbr0
Using IP Address: dhcp
Using Gateway IP Address: Default
Using APT-Cacher IP Address: Default
Disable IPv6: yes
Using Interface MTU Size: Default
Using DNS Search Domain: Host
Using DNS Server IP Address: Host
Using MAC Address: AE:1A:60:07:B7:59
Using Vlan: Default
Enable Root SSH Access: no
Enable Verbose Mode: no
Creating a Paperless-ngx LXC using the above advanced settings
 ✓ Using local for Template Storage.
 ✓ Using local-lvm for Container Storage.
 ✓ Updated LXC Template List
 ✓ LXC Container 111 was successfully created.
 ✓ Started LXC Container
 ✓ Set up Container OS
 ✓ Network Connected: 192.168.86.253 
 ✓ Internet Connected
 ✓ DNS Resolved github.com to 140.82.113.4
 ✓ Updated Container OS
 ✓ Installed Python3
 ✓ Installed Dependencies
 ✓ 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 should be reachable by going to the following URL.
         http://192.168.86.253:8000 

Screenshot 2024-01-16 6 25 15 AM

tteck commented 9 months ago
root@paperless-ngx:~# systemctl status paperless-webserver.service
* paperless-webserver.service - Paperless webserver
     Loaded: loaded (/etc/systemd/system/paperless-webserver.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-01-16 06:24:04 EST; 6min ago
   Main PID: 23651 (gunicorn: maste)
      Tasks: 14 (limit: 38256)
     Memory: 104.4M
        CPU: 1.307s
     CGroup: /system.slice/paperless-webserver.service
             |-23651 "gunicorn: master [paperless.asgi:application]"
             `-23803 "gunicorn: worker [paperless.asgi:application]"

Jan 16 06:24:04 paperless-ngx systemd[1]: Started paperless-webserver.service - Paperless webserver.
Jan 16 06:24:06 paperless-ngx gunicorn[23651]: [2024-01-16 11:24:06 +0000] [23651] [INFO] Starting gunicorn 21.2.0
Jan 16 06:24:06 paperless-ngx gunicorn[23651]: [2024-01-16 11:24:06 +0000] [23651] [INFO] Listening at: http://[::]:8000 (23>
Jan 16 06:24:06 paperless-ngx gunicorn[23651]: [2024-01-16 11:24:06 +0000] [23651] [INFO] Using worker: paperless.workers.Co>
Jan 16 06:24:06 paperless-ngx gunicorn[23651]: [2024-01-16 11:24:06 +0000] [23651] [INFO] Server is ready. Spawning workers
Jan 16 06:24:25 paperless-ngx gunicorn[23803]: /usr/local/lib/python3.11/dist-packages/django/http/response.py:517: Warning:>
Jan 16 06:24:25 paperless-ngx gunicorn[23803]:   warnings.warn(
lines 1-18/18 (END)
tteck commented 9 months ago

Also IPv6 disabled, in router and via script.

tteck commented 9 months ago

If I cannot reproduce the problem on my side, I cannot address an issue that appears to be functioning correctly here. As this issue is unrelated to the script, it is considered closed.

tikismoke commented 9 months ago

Indeed the script works correctly, it might also affect other peolple that's why i reported it (with the solution). Modify the gunicorn file works so it might comes from how the gunicorn script lookup ip to listen to.

I got the same nevermind wich disto i choose.

Cheer's

tikismoke commented 9 months ago

Does your pve host as IPV6 enable?

tikismoke commented 9 months ago

OK looks like this: https://github.com/paperless-ngx/paperless-ngx/issues/1356