Questions tagged [gunicorn]

1

votes
3

answer
194

Views

Django use 'python manage.py' runserver instead Gunicorn

I have a django project hosted on an amazon ec2 linux instance. For run my app also when section is close i use gunicorn but i experience some errors and degradation in perfonrmances. When i run command: python manage.py runserver from terminal all works great but when section is close app does not...
AleMal
1

votes
1

answer
395

Views

Cannot send email using django and nginx(gunicorn) on digital ocean droplet

I deployed a website using django + nginx + gunicorn on a ubuntu droplet. And I use the email function of django. However, every time I tried to send email, I got a 502 error in my website. And my nginx error log is: [error] 24933#24933: *30944 upstream prematurely closed connection while reading re...
Owen
1

votes
0

answer
64

Views

Paralelism with Gunicorn, Ngnix and Celery

i am not sure how paralelism can be or should be combined between gunicorn and celery (and probably ngnix). 1) So first of all I use Nginx. 2) Secondly, i run gunicorn like this gunicorn -k gevent --worker-connections 1001 --bind=unix:myapp.sock -m 007 wsgi:application 3) Thirdly i run celery like t...
Laimonas Sutkus
1

votes
1

answer
320

Views

Gunicorn not using right settings file Django?

In my wsgi.py I am conditionally setting DJANGO_SETTINGS_MODULE to two different files(local and production). On the server I have set 'PROD' variable in /etc/profile if 'PROD' in os.environ: os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') else: os.environ.setdefault('DJANGO_S...
Coderaemon
1

votes
0

answer
312

Views

Using pyMongo and APscheduler with Gunicorn --preload option

I start gunicorn with 3 workers (--workers 3) to launch a flask app and jobs configured with APscheduler. In order to launch my jobs just once (and not once per worker) I use the --preload option. However, my issue is that I also use pyMongo which does not work safe with the gunicorn --preload optio...
Benjamin
1

votes
0

answer
60

Views

nginx/gunicorn log initial request on receive not after processing?

Both Nginx & gunicorn log requests AFTER they have processed them. Two questions, is the timestamp then related to when the response is finalised and sent back and if so is there a way to log initial request received time in either server log?
user1561108
1

votes
0

answer
288

Views

Configure apache 2 using SSL with proxy to gunicorn server in Solaris 11

I have a python flask application and I am using Gunicorn as the WSGI - Gateway Interface server to the application. I have installed Apache 2.2 web server which captures the user's request and forwards it to Gunicorn through ProxyPass. The whole thing is running on Solaris 11. I have created a sel...
chandan p
1

votes
0

answer
124

Views

Nginx, gunicorn, flask cache not updating - solution: restart instance

I have a server running nginx, gunicorn and flask. My problem isn't that the usual thing, that forwarding from nginx to gunicorn doesn't happen. My problem is that nginx forwards to my running gunicorn server half the time and to my index.html files in my directory appdirectory/templates the other h...
Christian
1

votes
0

answer
25

Views

Git post-receive with gunicorn start, exit to terminal

I need a bit of help, when I push to my git server I have this post-receive code: #!/bin/bash TRAGET='/var/www/app' GIT_DIR='/opt/git/app.git' BRANCH='master' while read oldrev newrev ref do # only checking out the master (or whatever branch you would like to deploy) if [[ $ref = refs/heads/$BRANCH...
Filip Stefanović
1

votes
1

answer
258

Views

502 bad gateway with supervisor but not with gunicorn

I am setting up a test server at home. The web app is built with flask and python 3.6. For setting up the web server with nginx and gunicorn I followed the guide Real Python Tutorial. This use supervisor for the final management engine. The problem is I don't know where to start looking to find the...
Boomatang
1

votes
0

answer
296

Views

gunicorn socket EPIPE

Why there is some difference when testing by curl and nc? Load balance using the command nc to check whether gunicorn is ok. But its reponse code is not 2xx or 3xx when using 'nc'. 4xx is considered to be unhealthy. Some config: nginx-gunicorn.conf upstream app_server { server unix:/tmp/gunicorn.soc...
zhangsan
1

votes
0

answer
1.4k

Views

How to see Nginx log?

When I want to see the Gunicorn log to see if I have any errors, I do gunicorn --log-file=- .wsgi:application - what command do I use to see the Nginx log?
Zorgan
1

votes
1

answer
447

Views

Using Gunicorn and Multiprocess with a Flask app

So I'm trying to write a Flask app that has a block of code running once every ten minutes, pulling down and processing a file. The way I currently trigger that block of code to run is a loop that sees if the delta between the current time and the last time the block of code ran is greater than ten...
Boyd Christiansen
1

votes
0

answer
49

Views

git server and django program inside nginx

I want to run a git server inside my django program. my nginx config is like this: server{ listen 192.168.1.250:80; root /var/www/html/git; location /server\.git { client_max_body_size 0; # Git pushes can be massive, just to make sure nginx doesn't suddenly cut the connection...
Mohammad Ali
1

votes
1

answer
174

Views

Django, Gunicorn, Nginx, Postgres, Digitial Ocean Server Error 500 on Image Upload

I am developing a website/blog using Django and am in the middle of figuring out the proper setup/settings. I am running Ubuntu Server 16.04 in a virtual machine for testing. I am using what seems to be a common setup with Gunicorn and Nginx as well as PostgreSQL for the database and hosting the s...
Brandon Q
1

votes
1

answer
227

Views

Heroku flask deployment issue - logs shows gunicorn: error: unrecognized arguments: app:app

We have a small flask project here https://github.com/codesydney/OPEND It is working as expected locally. However, when deployed to heroku, it keeps on throwing gunicorn: error: unrecognized arguments: app:app. Procfile content is 'web: gunicorn app:app'. Thanks in advance for your help. Cheers!
Engramar Bollas
1

votes
0

answer
140

Views

Issue with SSL, nginx, gunicorn, and Django in production

I'm having an issue getting nginx to pass over control of routing to my django server. By default it checks '/' path and if the user isn't logged in redirects to '/login' and then upon login passes it back to '/'. The login page works fine until you submit then it throws an 'Internal server error'...
Justin Snyder
1

votes
0

answer
36

Views

Safe to replace my domain name on my Django application?

Will I face any repercussions for replacing the domain name on my Django application? It's running on Ubuntu 16.04 with Nginx/Gunicorn. Apart from ALLOWED_HOSTS in my settings.py, the other locations I would replace the domain is my Nginx conf file and also my Digital Ocean nameservers. A possible c...
Zorgan
1

votes
1

answer
209

Views

Getting 502 error when I try to send email, server setup by django, postgres, nginx, gunicorn

I am following this tutorial from digital ocean How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04 Everything is working fine except when I try to send email using gmail it throws 502 bad gateway. nginx log file shows 94 upstream prematurely closed connection while reading resp...
Amir
1

votes
0

answer
299

Views

Gunicorn failed to find application when run from a shell file but succeeds when run from cli directly

I am trying to run a gunicorn enclosing a python app but it keeps giving me failed to find application error. Here is the whole trace: [2018-03-06 22:17:39 +0000] [13278] [INFO] Starting gunicorn 19.7.1 [2018-03-06 22:17:39 +0000] [13278] [INFO] Listening at: http://0.0.0.0:7007 (13278) [2018-03-06...
A_Matar
1

votes
0

answer
123

Views

NGINX proxy config issues

I have a web app currently running on port 8000 and recently got an SSL certificate. I've installed nginx and attempted to have all port 80 and 443 traffic redirected to port 8000 on the local system. Here is where I am at: Browsing to the server on port 8000 still works and renders with no issue Br...
Cool_beans
0

votes
1

answer
334

Views

504 error when the view loading takes more than 5 s

I've got an installation with django-nginx-gunicorn-supervisor-postgresql. In the Django admin, I've got a 504 if the loading of the view takes more than around 5 seconds. For instance, if I filter a change list view with many records and takes more than that time, the 504 appears. The same view wit...
klautern
1

votes
1

answer
97

Views

Django Ajax post failed with Gunicorn and Nginx on AWS

I am writing a app using AJAX deployed by gunicorn and nginx on AWS. It works very well when I am using python3 manage.py runserver. But after I used gunicorn, the AJAX post doesn't work. I get a Failed to load resource: the server responded with a status of 404 (Not Found). What I did is a very si...
fourth
1

votes
0

answer
71

Views

Can werkzeug SimpleCache share data among gunicorn threads

I have a flask app based on gunicorn. Can I use werkzeug SimpleCache to share data among gunicorn threads?
Jojo
1

votes
0

answer
136

Views

Sentry send notification SystemExit: 1

On web server I'm using Python3.6, Django with Gunicorn and Supervisor. After deploy to server I began to receive notifications from Sentry like this: Message SystemExit: 1 Sentry log: https://sentry.io/share/issue/ddd8c6426d68494facfa0bdab9b01a2c/ What can be reason of this?
Arti
1

votes
3

answer
415

Views

Django not serving static files in production

settings.py: DEBUG = False STATIC_ROOT = '/opt/app/statics/' # URL prefix for static files. # Example: 'http://example.com/static/', 'http://static.example.com/' STATIC_URL = '/statics/' # Additional locations of static files STATICFILES_DIRS = (os.path.join(BASE_DIR, 'statics'),) urls.py from djang...
Johny Doe
1

votes
0

answer
183

Views

Python gunicorn duplicate logs

I wrote a module file that formats logs according to Google Stackdriver json standards. For doing so, I followed this guide. This is my module: import logging import sys from pythonjsonlogger import jsonlogger class _MaxLevelFilter(object): def __init__(self, highest_log_level): self._highest_log_le...
Mauricio
1

votes
0

answer
86

Views

How to specify gunicorn log max size

I'm running gunicorn as guiconrn --bind=0.0.0.0:5000 --log-file gunicorn.log myapp:app Seems like gunicorn.log keeps growing. Is there a way to specify a max size of the log file, so that if it reaches max size, it'll just override it. Thanks!!
Feiiiiiiiiiiiii
1

votes
1

answer
385

Views

Logging in gunicorn log file is not detailed

I'm setting log level to 'debug' which I recall is the most verbose, however I'm only getting lines like this, even when an exception is thrown: [2018-04-18 22:08:21 +0000] [23394] [DEBUG] POST /json My startup command is this: gunicorn --log-level debug --error-logfile gunicorn_error.log -D -b 0....
David
1

votes
0

answer
41

Views

Gunicorn retry limit

I deploy my app under gunicorn, and when my apps ran failed, I want to stop it instead of restarting with many times. There are any setting for limiting retries in gunicorn? I'm using gunicorn 19.7.1
Le Duong Tuan Anh
1

votes
0

answer
289

Views

Configuring NGINX on a flask web app in a Windows machine with Gunicorn

I have a web app written in Python flask and deployed to Heroku. It is also using Gunicorn. The main feature of this app is to serve static images. Gunicorn works fine with a low load of users but I want it to scale good in case my app will be used by thousands of people, I was advised to configure...
Randomizer
1

votes
1

answer
149

Views

gunicorn ImportError: No module named django_jalali

I'm running a project using django, nginx and gunicorn which works fine on local machine. When I moved the project to the server and installed everything, I tested the project using python3 manage.py runserver and it works fine. But when I try to run it using gunicorn, I ran to this error ImportErro...
Alex Jolig
1

votes
1

answer
182

Views

Airflow's Gunicorn is spamming error logs

I'm using Apache Airflow and recognized that the size of the gunicorn-error.log grown over 50 GB within 5 months. Most of the log messages are INFO level logs like: [2018-05-14 17:31:39 +0000] [29595] [INFO] Handling signal: ttou [2018-05-14 17:32:37 +0000] [2359] [INFO] Worker exiting (pid: 2359) [...
Stev
1

votes
0

answer
156

Views

Strategic error on Python/Flask deploy

I'm new to web development and deployment however I developed a web site using Python 2.7 and Flask. I can't get the site to load when the user hits the site. When testing on the server using SSH the program starts like it did on my development PC but does not render the first template and shows th...
Glenn
1

votes
1

answer
270

Views

NGINGX gives 502 Bad Gateway when trying to use NGINX + Gunicorn on Docker

I'm developing a Django app with a PostgreSQL database and I'm using NGINX + Gunicorn with Docker. PostgreSQL, NGINX and Gunicorn are on different containers communicating with networks. I can build my app with docker-compose build but when I execute it with docker-compose up and view my app in the...
Denisse
1

votes
1

answer
445

Views

Deploy Django static files with Apache/Gunicorn

I am using Apache2 with Gunicorn/Django to deploy my app. However my app doesn't display the static files like CSS sheets etc. I read many topics but I think I need help because I probably missed something... Setting.py ALLOWED_HOSTS = ['localhost'] STATIC_URL = '/static/' STATICFILES_DIRS = ( os.pa...
GrandGTO
1

votes
0

answer
114

Views

What is a good way to run django/flask management command on production

In a dockerized environment, we run django management command. Essentially running a management command like python manage.py command is single threaded. So Basically we are running single process within a docker container. Now if sometime db connection is reset or some process throws an unhandled e...
sprksh
1

votes
1

answer
208

Views

[Python Falcon]: gunicorn working in terminal but not in PyCharm

I am trying to run the falcon application in PyCharm so that I can run the debugger. I am able to start the falcon application from the command line, however I am not able to start it from PyCharm. The project structure is the following: FalconTutorial - service - __init__.py - app.py Here is the co...
learnerer
1

votes
1

answer
362

Views

Keras model is stuck at prediction level when running the server with gunicorn

I am using keras model to predict something and used flask-restplus to make this as a REST service. so far everything is working fine when I run the server with python app.py command. But I wanted to run this through gunicorn and nginx (gunicorn -b 0.0.0.0:5000 --error-logfile - -w 4 --access-logfil...
Reddi Mohan
1

votes
0

answer
38

Views

Gunicorn Excessive resource usage: Resource: Process Time

I'm using Gunicorn 19.8.1, Nginx 1.12.2 and Centos 7.5.1804. Every hour i receive four emails from my Web server: Time: Sat Jun 23 08:00:29 2018 +0200 Account: user Resource: Process Time Exceeded: 48863 > 1800 (seconds) Executable: /usr/bin/python2.7 Command Line: /usr/bin/py...
Ljubisa Livac

View additional questions