running gunicorn bind command in Jenkins background

0 votes

I am trying to run a django app in background using gunicorn app.wsgi:application --bind=0.0.0.0:1312 --daemon. It's working on ubuntu terminal but not not if I try and run in jenkins. some 502 nginx error comes up:

(111: Connection refused) while connecting to upstream, client: 106.51.133.80, s
$.80, server: 0.0.0.0:1312, request: "GET / HTTP/1.1", upstream: "http://0.0.0.0:1312/", host: "0.0.0.0:81"

Jun 26, 2018 in Jenkins by ffdfd
• 5,550 points
2,081 views

1 answer to this question.

0 votes

If you're getting a 502 error that means your back-end is not functioning properly. For jenkins these could be the reasons:

  1. your back end may not be starting at boot time
  2. Timeout may be occuring

For the first one try and run

sudo service --status-all

start the service by:

sudo service spawn-fcgi start

or

sudo /etc/init.d/spawn-fcgi start

Enable the service to start it on boot. google it

Other reason maybe a timeout error. Increase the buffer and timeout times

http {
...
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
...
}

answered Jun 26, 2018 by DareDev
• 6,890 points

Related Questions In Jenkins

+2 votes
3 answers

Permission denied error while running a simple job in Jenkins

Hey @Hannah, try changing the permissions using ...READ MORE

answered Oct 25, 2018 in Jenkins by krishti
58,592 views
0 votes
2 answers

What is the command to restart jenkins through command line in linux?

On Ubuntu or Debian, when installed through apt-get/dpkg: $ ...READ MORE

answered Aug 1, 2019 in Jenkins by Sirajul
• 59,230 points
20,759 views
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
0 votes
1 answer

unable to compile java code in Jenkins

If the code is compiling and running ...READ MORE

answered Apr 25, 2018 in Jenkins by DareDev
• 6,890 points
2,302 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP