paperless-ngx / paperless-ngx

A community-supported supercharged version of paperless: scan, index and archive all your physical documents
https://docs.paperless-ngx.com
GNU General Public License v3.0
21.92k stars 1.19k forks source link

[BUG] Gunicorn is not a valid port number after upgrade from paperless-ng #1624

Closed janis-ax closed 2 years ago

janis-ax commented 2 years ago

Description

After changing the docker image from paperless-ng to paperless-ngx I run into this issue, and it took me some time to solve it. So, it's solved now and this just for documentation.

I got the following error after starting the full stack: Error: 'tcp://10.43.223.199:8000' is not a valid port number. and Gunicorn exited then.

However, the problem was: The container does not use port 8000 which should be the default. You can fix this by setting the variable PAPERLESS_PORT again to 8000

Steps to reproduce

  1. Run paperless-ng in K3S / Docker with Reverse NGINX
  2. Change image to paperless-ngx

Webserver logs

Paperless-ngx docker container starting...
Creating directory /tmp/paperless
Adjusting permissions of paperless files. This may take a while.
Waiting for PostgreSQL to start...
Waiting for Redis: redis://localhost:6379
Connected to Redis broker: redis://localhost:6379
Apply database migrations...
Operations to perform:
  Apply all migrations: admin, auth, authtoken, contenttypes, django_q, documents, paperless_mail, sessions
Running migrations:
  No migrations to apply.
Did not create superuser, a user paperless already exists
Executing /usr/local/bin/paperless_cmd.sh
2022-09-19 17:29:59,847 INFO Set uid to user 0 succeeded
2022-09-19 17:29:59,849 INFO supervisord started with pid 49
2022-09-19 17:30:00,851 INFO spawned: 'consumer' with pid 50
2022-09-19 17:30:00,853 INFO spawned: 'gunicorn' with pid 51
2022-09-19 17:30:00,854 INFO spawned: 'scheduler' with pid 52

Error: 'tcp://10.43.223.199:8000' is not a valid port number.

2022-09-19 17:30:01,338 INFO exited: gunicorn (exit status 1; not expected)
[2022-09-19 19:30:01,844] [INFO] [paperless.management.consumer] Using inotify to watch directory for changes: /usr/src/paperless/consume
19:30:01 [Q] INFO Q Cluster jig-crazy-angel-april starting.
2022-09-19 17:30:01,930 INFO success: consumer entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-09-19 17:30:01,930 INFO success: scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
19:30:01 [Q] INFO Process-1:1 ready for work at 68
19:30:01 [Q] INFO Process-1:2 monitoring at 69
19:30:01 [Q] INFO Process-1 guarding cluster jig-crazy-angel-april
19:30:01 [Q] INFO Process-1:3 pushing tasks at 70
19:30:01 [Q] INFO Q Cluster jig-crazy-angel-april running.
2022-09-19 17:30:02,947 INFO spawned: 'gunicorn' with pid 71

Error: 'tcp://10.43.223.199:8000' is not a valid port number.

2022-09-19 17:30:03,330 INFO exited: gunicorn (exit status 1; not expected)
2022-09-19 17:30:05,335 INFO spawned: 'gunicorn' with pid 73

Error: 'tcp://10.43.223.199:8000' is not a valid port number.

2022-09-19 17:30:05,727 INFO exited: gunicorn (exit status 1; not expected)
2022-09-19 17:30:08,732 INFO spawned: 'gunicorn' with pid 75

Error: 'tcp://10.43.223.199:8000' is not a valid port number.

Paperless-ngx version

1.8.0

Host OS

K3S

Installation method

Docker - official image

Browser

No response

Configuration changes

No response

Other

Upgrade from paperless-ng

stumpylog commented 2 years ago

If there's a good place in the docs to add a hint or 2 about running with a more advanced setup, we'd be happy to have a PR for it. I know zero about the differences of Kubernetes that would lead to this.

janis-ax commented 2 years ago

Good point. If I have some time I will describe my K8S setup. Let's leave this issue some days open to add the docs, okay?

fwmarcel commented 2 years ago

hello all, i am also just running paperless in my kubernetes cluster (k3s). and have the same error.

Many greetings

janis-ax commented 2 years ago

Hi @fwmarcel For me following worked:

You can fix this by setting the variable PAPERLESS_PORT again to 8000

fwmarcel commented 2 years ago

hi @janis-ax this fix worked. thanks!

stumpylog commented 2 years ago

Do you want to document this in the advanced setup area maybe? Since this seems Kubernetes specific, I think that's pretty advanced for most people.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.