ELB processes are not healthy on all instances - amazon-web-services

I am trying to deploy a Python Dash app to EC2 and have been trying to figure out this error for the past two days (ELB processes are not healthy on all instances;
ELB health is failing or not available for all instances). I'm able to log into the app using the amazon url but it seems like it is not calling the api properly. I suspect the instance is not connected to the internet.
I have tried spinning up new instances multiple times but am still getting the same result.
/nginx/error.log:
2022/09/26 14:41:48 [warn] 3543#3543: *339 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/1/00/0000000001 while reading upstream, client: 172.31.18.14, server: , request: "GET /_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 14:41:50 [warn] 3543#3543: *333 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/2/00/0000000002 while reading upstream, client: 172.31.18.14, server: , request: "GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/async-plotlyjs.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 15:16:56 [warn] 3543#3543: *913 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/3/00/0000000003 while reading upstream, client: 172.31.11.113, server: , request: "GET /_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 15:16:57 [warn] 3543#3543: *913 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/4/00/0000000004 while reading upstream, client: 172.31.11.113, server: , request: "GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/async-plotlyjs.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 16:09:19 [warn] 30490#30490: *811 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/1/00/0000000001 while reading upstream, client: 172.31.18.14, server: , request: "GET /_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/dash_core_components.v2_6_1m1664202069.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 16:09:20 [warn] 30490#30490: *817 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/2/00/0000000002 while reading upstream, client: 172.31.18.14, server: , request: "GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/async-plotlyjs.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"
2022/09/26 16:17:54 [warn] 31572#31572: *13 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/1/00/0000000001 while reading upstream, client: 172.31.11.113, server: , request: "GET /_dash-component-suites/dash/dcc/async-plotlyjs.js HTTP/1.1", upstream: "http://127.0.0.1:8000/_dash-component-suites/dash/dcc/async-plotlyjs.js", host: "myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com", referrer: "http://myapp-env.eba-ppvbbqir.us-east-1.elasticbeanstalk.com/"

Related

intermittent 502 Bad Gateway nginx/1.18.0 (Ubuntu)

My django app has ben running for about 3 months now.
I intermittently get a 502 Bad Gateway error message on any page,
I will even get this error the Django admin page, so I don't think its my code. Most of the time the page loads fine, or if I just reload it will load.
can someone help me understand where I'm making a mistake
The output from sudo tail -20 /var/log/nginx/error.log yields:
2022/03/29 16:12:56 [error] 720#720: *8182 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /backyard/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/backyard/", host: "104.131.165.99", referrer: "http://104.131.165.99/backyard/"
2022/03/29 16:19:44 [error] 720#720: *8188 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 16:26:29 [error] 720#720: *8194 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 16:36:30 [error] 720#720: *8205 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 16:42:58 [error] 720#720: *8209 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /backyard/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/backyard/", host: "104.131.165.99", referrer: "http://104.131.165.99/backyard/"
2022/03/29 16:49:45 [error] 720#720: *8221 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:09:45 [error] 720#720: *8244 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:12:57 [error] 720#720: *8251 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /backyard/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/backyard/", host: "104.131.165.99", referrer: "http://104.131.165.99/backyard/"
2022/03/29 17:16:54 [error] 720#720: *8255 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:23:04 [error] 720#720: *8261 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:29:44 [error] 720#720: *8265 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:33:10 [error] 720#720: *8269 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:46:25 [error] 720#720: *8282 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 17:49:47 [error] 720#720: *8284 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 18:40:19 [error] 720#720: *8303 upstream prematurely closed connection while reading response header from upstream, client: 73.178.103.149, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99"
2022/03/29 18:44:53 [error] 720#720: *8310 upstream prematurely closed connection while reading response header from upstream, client: 73.178.103.149, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 18:50:50 [error] 720#720: *8320 upstream prematurely closed connection while reading response header from upstream, client: 73.178.103.149, server: _, request: "GET /admin/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/admin/", host: "104.131.165.99"
2022/03/29 18:51:19 [error] 720#720: *8319 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 73.178.103.149, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 18:52:56 [error] 720#720: *8324 upstream prematurely closed connection while reading response header from upstream, client: 73.178.103.149, server: _, request: "GET /garage/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/garage/", host: "104.131.165.99", referrer: "http://104.131.165.99/garage/"
2022/03/29 18:52:56 [error] 720#720: *8327 upstream prematurely closed connection while reading response header from upstream, client: 165.225.38.84, server: _, request: "GET /backyard/ HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/backyard/", host: "104.131.165.99", referrer: "http://104.131.165.99/backyard/"

AWS elasticbeanstalk with django isn't Working

]
I've never used an AWS Beanstalk before, and I get this error, and when I actually get to the address, the "502 badgateway" error is executed how can I solve this problem?(I'm using django)
Edit
I also downloaded the log and those are the errors
eb_engine.log
2020/07/13 02:49:45.963964 [ERROR] /usr/bin/id: healthd: no such user
2020/07/13 02:49:46.338947 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/healthd.service to /etc/systemd/system/healthd.service.
2020/07/13 02:49:46.746061 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/cfn-hup.service to
/etc/systemd/system/cfn-hup.service.
2020/07/13 02:50:26.754823 [ERROR] Creating a Pipfile for this project…
Requirements file provided! Importing into Pipfile…
2020/07/13 02:50:28.038589 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/eb-app.target to /etc/systemd/system/eb-app.target.
2020/07/13 02:50:28.121446 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/web.service to /etc/systemd/system/web.service.
2020/07/13 02:50:28.171612 [ERROR] nginx: the configuration file /var/proxy/staging/nginx/nginx.conf syntax is ok
nginx error
2020/07/13 03:00:43 [error] 3758#0: *140 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "52.79.129.169"
2020/07/13 03:02:41 [error] 3758#0: *162 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.10.51, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "13.209.157.1"
2020/07/13 03:15:07 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:08 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:08 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:08 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:08 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:08 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
2020/07/13 03:15:09 [error] 3758#0: *347 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.46.96, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "www.sewontax.com"
daemon
error (Invalid timestamp): {:id=>"0", :namespace=>"application", :timestamp=>1594609370, :data=>"{\"duration\":10,\"latency_histogram\":[[0.0,1]],\"http_counters\":{\"status_502\":1,\"request_count\":1}}"}

502 Bad gateway nginx with gunicorn & django

I'm deploying django project using gunicorn and nginx. My nginx setting is,
server {
listen 8000;
server_name 0.0.0.0;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/gagan/saporawebapp;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/gagan/saporawebapp/saporawebapp.sock;
}
}
when i run
sudo nginx -t
It shows that setup is correct . Then i started gunicorn using
gunicorn --daemon --workers 3 --bind unix:/home/gagan/saporawebapp/saporawebapp.sock saporawebapp.wsgi
Then nginx is showing 502 bad gateway. Corresponding error log is,
2019/10/08 07:51:34 [emerg] 3988#3988: open() "/etc/nginx/sites-enabled/saporawebapp" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
2019/10/08 07:59:54 [crit] 4278#4278: *1 connect() to unix:/home/ubuntu/myproject/myproject.sock failed (2: No such file or directory) while connecting to upstream, client: 42.108.169.252, server: 0.0.0.0, request: "GET /signup/ HTTP/1.1", upstream: "http://unix:/home/ubuntu/myproject/myproject.sock:/signup/", host: "157.245.108.160:8000"
2019/10/08 08:05:19 [crit] 4278#4278: *5 connect() to unix:/home/ubuntu/myproject/myproject.sock failed (2: No such file or directory) while connecting to upstream, client: 42.108.169.252, server: 0.0.0.0, request: "GET /signup/ HTTP/1.1", upstream: "http://unix:/home/ubuntu/myproject/myproject.sock:/signup/", host: "157.245.108.160:8000"
2019/10/08 08:06:24 [crit] 4744#4744: *1 connect() to unix:/home/ubuntu/myproject/myproject.sock failed (2: No such file or directory) while connecting to upstream, client: 42.108.169.252, server: 0.0.0.0, request: "GET /signup/ HTTP/1.1", upstream: "http://unix:/home/ubuntu/myproject/myproject.sock:/signup/", host: "157.245.108.160:8000"
2019/10/08 08:14:47 [alert] 5279#5279: 768 worker_connections are not enough
2019/10/08 08:14:47 [error] 5279#5279: *763 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 157.245.108.160, server: 0.0.0.0, request: "GET /signup/ HTTP/1.0", upstream: "http://157.245.108.160:8000/signup/", host: "157.245.108.160:8000"
2019/10/08 09:49:53 [crit] 11601#11601: *1 connect() to unix:/home/gagan/saporawebapp/saporawebapp.sock failed (2: No such file or directory) while connecting to upstream, client: 42.108.169.252, server: 0.0.0.0, request: "GET / HTTP/1.1", upstream: "http://unix:/home/gagan/saporawebapp/saporawebapp.sock:/", host: "157.245.108.160:8000"

Why is my Springboot deployment to EBS not working?

I am trying to deploy a small SpringBoot application to EBS. I think I have done everything right, including setting up an RDS database, but the deployment fails and I get an error with health degraded as : Following services are not running: application-web-1.
My variables are setup as follows
GRADLE_HOME
/usr/local/gradle
JAVA_HOME
/usr/lib/jvm/java
M2
/usr/local/apache-maven/bin
M2_HOME
/usr/local/apache-maven
SERVER_PORT
5000
SPRING_DATASOURCE_PASSWORD
***
SPRING_DATASOURCE_URL
jdbc:mysql://***.us-east-2.rds.amazonaws.com/ebdb
SPRING_DATASOURCE_USERNAME
***
SPRING_JPA_DATABASE_PLATFORM
org.hibernate.dialect.MySQL5Dialect
SPRING_JPA_HIBERNATE_DDL_AUTO
***
SPRING_PROFILES_ACTIVE
prod
Any advice on how to debug?
My logs below:
-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2019/03/17 19:02:16 [error] 4817#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 82.29.139.73, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 19:02:17 [error] 4817#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 82.29.139.73, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 19:02:25 [error] 4817#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 82.29.139.73, server: , request: "GET /links/ HTTP/1.1", upstream: "http://127.0.0.1:5000/links/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 19:02:26 [error] 4817#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 82.29.139.73, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/links/"
2019/03/17 19:57:28 [error] 4817#0: *7 connect() failed (111: Connection refused) while connecting to upstream, client: 178.73.215.171, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:5000/"
2019/03/17 20:53:11 [error] 4817#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 104.152.52.21, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:5000/"
2019/03/17 20:57:57 [error] 4817#0: *11 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 20:57:58 [error] 4817#0: *11 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:06:08 [error] 29457#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:06:08 [error] 29457#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:15:47 [error] 30143#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:15:48 [error] 30143#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:15:54 [error] 30143#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:15:54 [error] 30143#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:25:28 [error] 30981#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:25:28 [error] 30981#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:29:36 [error] 31520#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:29:36 [error] 31520#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
2019/03/17 21:34:37 [error] 31520#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com"
2019/03/17 21:34:37 [error] 31520#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 151.229.68.196, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com", referrer: "http://ddemo-env.ipmbyempmi.us-east-2.elasticbeanstalk.com/"
Hey I'm not sure if this will work for you, but this is how I solved the
Following services are not running: application-web-1.
issue. I ssh'd onto my elastic beanstalk instance and cd'd to the /var/log directory. I noticed that there was a
web-1.error.log
log showing. I vi'd that log file and there was the exception that was causing the deployment to fail. A txt file that was nested inside a folder within my resources folder was not visible and the following exception was being thrown.
Caused by: java.io.FileNotFoundException: URL [jar:file:/var/app/current/application.jar!/BOOT-INF/classes!/vegetables/vegetables.txt] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/var/app/current/application.jar!/BOOT-INF/classes!/vegetables/vegetables.txt
This occurred because I was using PathMatchingResourcePatternResolver to get the resources, then traversing the resources by filename, and directly trying to access the file by using resource.getFile(). Instead of getting the data by the file. I used
byte[] dataArr = FileCopyUtils.copyToByteArray(resource.getInputStream());
and that allowed me to use the data in the byte array the same way I used it by accessing the file directly. I hope this helps.

502 Bad Gateway Django

I have a simple application that allows you to upload images onto the server, and it is set up on my production server which consist of django + uwsgi + ngnix .
I have a problem when trying to upload an image. I get the following error:
error
502 Bad Gateway
nginx/1.2.1
function:
def upload(request):
form = ImageForm()
context = {'form':form,}
context.update(csrf(request))
if request.POST:
form = ImageForm(request.POST, request.FILES)
if form_is.valid():
image = request.FILES.get('image')
CarPhoto.objects.create(user=request.user,cars=1,description='dwq',image=image)
return HttpResponseRedirect(reverse('transformer:kevin'))
return render_to_response('image.html',context,context_instance=RequestContext(request))
template
<form method="POST" enctype="multipart/form-data" action=".">
{% csrf_token %}
<div id="c">image</div> {{form.image}}
<input type = "submit" value= "add" id="box2"/>
</form>
The mysite.com_error.log
"uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:07:39 [error] 28870#0: *5 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:08:12 [error] 29065#0: *5 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:08:18 [error] 29065#0: *7 readv() failed (104: Connection reset by peer) while reading upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:09:11 [error] 29065#0: *9 readv() failed (104: Connection reset by peer) while reading upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:09:52 [error] 29065#0: *14 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
2013/06/26 12:10:51 [error] 29065#0: *19 sendfile() failed (32: Broken pipe) while sending request to upstream, client: 313.19.220.424, server: mysite.com, request: "POST /car/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.com.sock:", host: "174.414.14.551", referrer: "http://174.414.14.551/car/upload"
It sounds like your uWSGI instance has died or is failing in such a way that it does not know how to answer.
Start by watching the nginx logs in addition to the uWSGI logs and see how far it gets.
Perhaps the file you are uploading is so large it is choking some front streaming portion.
Edit your post to indicate the output of the two log files and we will see.
if third party app included in your project then it should be installed on your server also like south is third party app.
Consider south is included in your settings.py file then south should be installed on your server also.
If that module consider south here, is already installed on server then try to upgrade it. Because it is possible that you are using upgraded version of module on local machine and older version is installed in the server.