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,470 points
166 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,520 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
2,813 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,900 points
1,050 views
0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,000 points
187 views
+2 votes
5 answers
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,100 points
239 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,100 points
24 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,520 points
89 views
0 votes
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.