Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gunicorn not create unix socket #1166

Closed
fellipeh opened this issue Dec 17, 2015 · 7 comments
Closed

gunicorn not create unix socket #1166

fellipeh opened this issue Dec 17, 2015 · 7 comments

Comments

@fellipeh
Copy link

Hello,

I have these code, but doesn't create any bind file... what's the problem in my code?

I`m using latest version of gunicorn.

exec $HOME_VENV/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
   --name $NAME \
   --workers $NUM_WORKERS \
   --user=$USER --group=$GROUP \
   --log-level debug \
   --log-file $LOGFILE \
   --bind=unix:$SOCKFILE

I try these: --bind unix:$SOCKFILE but not working

All variables has value, and are correctly.. I check 3 times...

@benoitc
Copy link
Owner

benoitc commented Dec 23, 2015

both unix:// and unix: syntaxes work for me:

(gunicorn_py3)[examples] gunicorn -b unix://test.sock -w3 test:app                                    8:43:55  ☁  master ☀
[2015-12-23 08:43:59 +0100] [54608] [INFO] Starting gunicorn 19.4.1
[2015-12-23 08:43:59 +0100] [54608] [INFO] Listening at: unix:test.sock (54608)
[2015-12-23 08:43:59 +0100] [54608] [INFO] Using worker: sync
[2015-12-23 08:43:59 +0100] [54611] [INFO] Booting worker with pid: 54611
[2015-12-23 08:43:59 +0100] [54612] [INFO] Booting worker with pid: 54612
[2015-12-23 08:43:59 +0100] [54613] [INFO] Booting worker with pid: 54613
(gunicorn_py3)[examples] gunicorn -b unix:test.sock -w3 test:app                                      8:45:56  ☁  master ☀
[2015-12-23 08:46:01 +0100] [54685] [INFO] Starting gunicorn 19.4.1
[2015-12-23 08:46:01 +0100] [54685] [INFO] Listening at: unix:test.sock (54685)
[2015-12-23 08:46:01 +0100] [54685] [INFO] Using worker: sync
[2015-12-23 08:46:01 +0100] [54688] [INFO] Booting worker with pid: 54688
[2015-12-23 08:46:01 +0100] [54689] [INFO] Booting worker with pid: 54689
[2015-12-23 08:46:01 +0100] [54690] [INFO] Booting worker with pid: 54690

Which error do you have?

@fellipeh
Copy link
Author

Hi, thanks for response.

I don't get any error, gunicorn always start listening at: 127.0.0.0.1:8000... I run with --debug and show me this:

[2015-12-17 18:52:00 +0000] [19877] [DEBUG] Current configuration:
  2   statsd_host: None
  3   raw_env: []
  4   pidfile: None
  5   forwarded_allow_ips: ['127.0.0.1']
  6   limit_request_fields: 100
  7   proxy_allow_ips: ['127.0.0.1']
  8   when_ready: <function WhenReady.when_ready at 0x7f2ebdef5510>
  9   post_fork: <function Postfork.post_fork at 0x7f2ebdef5840>
 10   worker_int: <function WorkerInt.worker_int at 0x7f2ebdef5b70>
 11   post_request: <function PostRequest.post_request at 0x7f2ebdef81e0>
 12   syslog_addr: udp://localhost:514
 13   ca_certs: None
 14   worker_class: sync
 15   preload_app: False
 16   sendfile: True
 17   proxy_protocol: False
 18   logger_class: gunicorn.glogging.Logger
 19   suppress_ragged_eofs: True
 20   bind: ['127.0.0.1:8000']
 21   post_worker_init: <function PostWorkerInit.post_worker_init at 0x7f2ebdef59d8>
 22   worker_exit: <function WorkerExit.worker_exit at 0x7f2ebdef8378>
 23   workers: 1
 24   user: 1000
 25   spew: False
 26   max_requests_jitter: 0
 27   tmp_upload_dir: None
 28   access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
 29   django_settings: None
 30   errorlog: /home/ubuntu/sites/ds/log/gunicorn.log
 31   loglevel: debug
 32   logconfig: None
 33   on_starting: <function OnStarting.on_starting at 0x7f2ebdef51e0>
 34   syslog_facility: user
 35   daemon: False
 36   pythonpath: None
 37   statsd_prefix:
 38   timeout: 30
 39   certfile: None
 40   worker_connections: 1000
 41   group: 1000
 42   reload: False
 43   keyfile: None
 44   do_handshake_on_connect: False
 45   proc_name: ds
 46   limit_request_field_size: 8190
 keepalive: 2
 48   ssl_version: 3
 49   chdir: /home/ubuntu/sites/ds/app
 50   default_proc_name: digitumsoft.wsgi:application
 51   enable_stdio_inheritance: False
 52   worker_tmp_dir: None
 53   pre_fork: <function Prefork.pre_fork at 0x7f2ebdef56a8>
 54   syslog: False
 55   check_config: False
 56   syslog_prefix: None
 57   on_exit: <function OnExit.on_exit at 0x7f2ebdef86a8>
 58   umask: 0
 59   paste: None
 60   worker_abort: <function WorkerAbort.worker_abort at 0x7f2ebdef5d08>
 61   config: None
 62   on_reload: <function OnReload.on_reload at 0x7f2ebdef5378>
 63   threads: 1
 64   backlog: 2048
 65   nworkers_changed: <function NumWorkersChanged.nworkers_changed at 0x7f2ebdef8510>
 66   limit_request_line: 4094
 67   pre_request: <function PreRequest.pre_request at 0x7f2ebdef80d0>
 68   graceful_timeout: 30
 69   accesslog: None
 70   max_requests: 0
 71   pre_exec: <function PreExec.pre_exec at 0x7f2ebdef5ea0>
 72   secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-SSL': 'on', 'X-FORWARDED-PROTO': 'https'}
 73   cert_reqs: 0
 74   ciphers: TLSv1
75 [2015-12-21 10:35:21 +0000] [1175] [INFO] Starting gunicorn 19.4.1
76 [2015-12-21 10:35:21 +0000] [1175] [DEBUG] Arbiter booted
77 [2015-12-21 10:35:21 +0000] [1175] [INFO] Listening at: http://127.0.0.1:8000 (1175)
78 [2015-12-21 10:35:21 +0000] [1175] [INFO] Using worker: sync
79 [2015-12-21 10:35:21 +0000] [1235] [INFO] Booting worker with pid: 1235
80 [2015-12-21 10:35:21 +0000] [1175] [DEBUG] 1 workers

@fellipeh
Copy link
Author

I found my error!

The error is in my shell script..

my old version:

exec $HOME_VENV/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
   --name $NAME \
   --workers $NUM_WORKERS \
   --user=$USER --group=$GROUP \
   --log-level debug \
#   --log-file $LOGFILE \
   --bind=unix:$SOCKFILE

my new version:

exec $HOME_VENV/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
   --name $NAME \
   --workers $NUM_WORKERS \
   --user=$USER --group=$GROUP \
   --log-level debug \
   --bind=unix:$SOCKFILE

I thought put the "comment" in line was work.. but appears not... the comment in that line, makes shell script not read the next line...

Sorry abou that!

@benoitc
Copy link
Owner

benoitc commented Dec 23, 2015

@fellipeh oh! nice error ;) now worries and thanks for the feedback :)

@shinde-prasad
Copy link

hi @benoitc , I am not getting error but can not see webpage, my comand prompt doesnt go ahead, please see below logs:

Successfully tagged gunicorn_docker_web:latest
Starting gunicorn_docker_web_1 ... done
Attaching to gunicorn_docker_web_1
web_1 | Starting nginx
web_1 | Starting Gunicorn.
web_1 | ==> /srv/logs/access.log <==
web_1 |
web_1 | ==> /srv/logs/gunicorn.log <==
web_1 | * Starting nginx nginx
web_1 | [2018-08-28 06:46:58 +0000] [10] [INFO] Starting gunicorn 19.8.1
web_1 | [2018-08-28 06:46:58 +0000] [10] [INFO] Listening at: unix:cdmapp.sock (10)
web_1 | [2018-08-28 06:46:58 +0000] [10] [INFO] Using worker: sync
web_1 | [2018-08-28 06:46:58 +0000] [28] [INFO] Booting worker with pid: 28
web_1 | [2018-08-28 06:46:58 +0000] [29] [INFO] Booting worker with pid: 29
web_1 | [2018-08-28 06:46:58 +0000] [32] [INFO] Booting worker with pid: 32

your help is much apprecited

@shinde-prasad
Copy link

hi @benoitc could you please respond at the earliest?

@tilgovi
Copy link
Collaborator

tilgovi commented Aug 29, 2018

@shinde-prasad your report does not seem obviously related to this ticket. Did you check inside the container to see if the socket is created or not?

Please post a new issue, include the command you use to invoke gunicorn, and any other configuration that might help debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants