Rails - Elastick Beanstalk nginx/error.log

2019-02-20 03:01发布

Trying to upload my rails app to elastic beanstalk. I have successfully deployed my app and created postgres database. My app works on sqlite3 on development server.

my eb status is ready and health is green.

my eb logs file;

/var/log/nginx/error.log
-------------------------------------
2016/05/27 11:15:44 [warn] 2797#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:27:26 [crit] 2805#0: *140 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.26.77, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:34:45 [crit] 2805#0: *262 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"
2016/05/27 11:40:48 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com"
2016/05/27 11:40:49 [crit] 2805#0: *353 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.46.145, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com", referrer: "http://viravira-env.bu2eqpbwny.us-west-2.elasticbeanstalk.com/"



-------------------------------------
/var/log/puma/puma.log
-------------------------------------
=== puma startup: 2016-05-27 11:52:07 +0000 ===
=== puma startup: 2016-05-27 11:52:07 +0000 ===
[23871] - Worker 0 (pid: 23875) booted, phase: 0
[23871] - Gracefully shutting down workers...
[23871] === puma shutdown: 2016-05-27 12:36:32 +0000 ===
[23871] - Goodbye!
=== puma startup: 2016-05-27 12:36:35 +0000 ===
=== puma startup: 2016-05-27 12:36:35 +0000 ===
[24886] - Worker 0 (pid: 24890) booted, phase: 0

I am fairly new to eb so I wonder if the problem occurs because of the followings;

  1. I have not installed node that is why it can not connect
  2. Or I have problems with the security groups. I have 4 total as seen in the picture. enter image description here

my network interfaces; enter image description here when I try to detach RDS security group, it gives an error no authorization, even though I signed in as root. enter image description here
I have been trying to solve the problem for hours now and really appreciate any help!

EDIT I think I m having same issue as here. But could not understand how to solve it

1条回答
Melony?
2楼-- · 2019-02-20 03:23

Your problem is very clear from the Nginx log:

connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream

It reads:

No such file or directory

This means that your socket doesn't not exist at this path:

/var/run/puma/my_app.sock

  1. You need to setup the path to be the same as in your Rails/Puma upstream(i.e. configuration)

  2. When you will do that don't forget to make sure that Nginx user can access that socket it will need RW access.

查看更多
登录 后发表回答