unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 687 forks source link

unknown config directive: user #2277

Open DaniilSezonov opened 3 years ago

DaniilSezonov commented 3 years ago

Sorry, but I saw the new issues that look like my case and thinking that i must create my own issue. I'm probably wrong. But maybe it is a real problem.

uwsgi.ini

chdir               = /var/www/html/
module              = configuration.wsgi:application
processes           = 4
socket              = /var/run/uwsgi/app.sock
chmod-socket        = 777
buffer-size         = 65535
strict              = true
master              = true
enable-threads      = true
vacuum              = true
single-interpreter  = true
die-on-term         = true
need-app            = true
disable-logging     = true
log-4xx             = true
log-5xx             = true
harakiri            = 60
max-requests        = 1000
max-worker-lifetime = 3600
reload-on-rss       = 2048
worker-reload-mercy = 60
cheaper-algo        = busyness
processes           = 128
cheaper             = 8
xrmx commented 3 years ago

There's no "user" in that uwsgi.ini, are you sure it's the one you are using?

DaniilSezonov commented 3 years ago

There's no "user" in that uwsgi.ini, are you sure it's the one you are using?

Yes, I noticed that too and it confused me. I'm almost 99% sure that i used that config. But my uwsgi instance working inside docker service and possible this is my mistake or missunderstanding.

DaniilSezonov commented 3 years ago

There's no "user" in that uwsgi.ini, are you sure it's the one you are using?

Unfortunately, I could not understand the reason of my problem and could not found the decision. Maybe, some more information can shed some light. We use uWSGI (version 2.0.19.1) for Django 3 web application (inside Docker container). image

Docker entrypoint looks like this:

...
uwsgi /var/www/html/docker/app/uwsgi.ini --uid="$UWGI_UID"

Where UWSGI_UID is UID for user "uwsgi" ).

Today I checked that configuration file inside docker container is corresponds the above. uwsgi.ini value inside container. image

And container logs look like:

image

Thank you for reading and sorry for my English !

SteveByerly commented 1 week ago

I ran into a similar issue because I was adding namespaced environment variables in Docker compose to configure my uwsgi.ini file, but didn't realize uWSGI already tries to parses all environment variables that start with UWSGI_. See uWSGI Docs.

My error:

[strict-mode] unknown config directive: bind-host

Caused by having UWSGI_BIND_HOST env var in my docker-compose.yml

web:
  # ...
  environment:
    UWSGI_BIND_HOST: "0.0.0.0"
    UWSGI_BIND_PORT: "8001"

Trying to configure the socket with env vars:

socket = $(UWSGI_BIND_HOST):$(UWSGI_BIND_PORT)