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 Atul
• 5,530 points
328 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;
...
}

Check these links for more info.

answered Jun 26, 2018 by DareDev
• 6,810 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
8,198 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 in Jenkins by Sirajul
• 37,480 points
704 views
+1 vote
2 answers

What possible return values are there in Jenkins plugin “Sonarqube scanner”

Use Webhooks in SonarQube Administration setup to ...READ MORE

answered Aug 3, 2018 in Jenkins by Nilesh
• 6,880 points
1,794 views
0 votes
1 answer
0 votes
1 answer

Avoid killing children when parent process is killed

I would recommend against your design as ...READ MORE

answered Sep 7, 2018 in Python by Priyaj
• 56,920 points
481 views
0 votes
1 answer

Avoid killing children when parent process is killed

I would recommend against your design as ...READ MORE

answered Sep 14, 2018 in Python by Priyaj
• 56,920 points
43 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,810 points
279 views
0 votes
2 answers