Rails 6 + Capistrano - No such puma.sock file

試著忘記壹切 提交于 2021-01-05 07:24:41

问题


please, I have a giant problem for more than 10 hours.

Whenever I run my application deployment in Rails, with Capistrano and Puma, and I run a restart of nginx, I see this error when I try to access my web:

enter image description here

When I access my nginx logs, I see the following error:

2020/12/29 04:09:50 [crit] 9536#9536: *73 connect() to unix:///home/ubuntu/apps/my_app/shared/tmp/sockets/my_app-puma.sock failed (2: No such file or directory) while connecting to upstream, client: [CLIENT_ID], server: , request: "GET / HTTP/1.1", upstream: "http://unix:///home/ubuntu/apps/my_app/shared/tmp/sockets/my_app-puma.sock:/", host: "[MY_HOST]"
2020/12/29 04:09:50 [crit] 9536#9536: *73 connect() to unix:///home/ubuntu/apps/my_app/shared/tmp/sockets/my_app-puma.sock failed (2: No such file or directory) while connecting to upstream, client: [CLIENT_ID], server: , request: "GET / HTTP/1.1", upstream: "http://unix:///home/ubuntu/apps/my_app/shared/tmp/sockets/my_app-puma.sock:/500.html", host: "[MY_HOST]"

Thanks in advance for someone's help. Because it has been over 10 hours that I am trying to solve this problem of missing the ".sock" file and I can't

Update 1:

Following a tutorial I create:

I create in the path: /etc/systemd/system a file: puma-website.service

Inside has:

After=network.target
[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple

# Preferably configure a non-privileged user
User=ubuntu
Group=ubuntu

# Specify the path to your puma application root
WorkingDirectory=/home/ubuntu/my_app/current

# Helpful for debugging socket activation, etc.
Environment=PUMA_DEBUG=1

#EnvironmentFile=/var/www/my-website.com/.env
# The command to start Puma
ExecStart=/home/ubuntu/.rbenv/shims/bundle exec puma -C /home/ubuntu/my_app/current/config/puma.rb
Restart=always

[Install]
WantedBy=multi-user.target

But I error: :/etc/systemd/system$ sudo systemctl status puma-website.service

● puma-website.service
   Loaded: loaded (/etc/systemd/system/puma-website.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-12-29 00:52:19 UTC; 12h ago
  Process: 4316 ExecStart=/home/ubuntu/.rbenv/shims/bundle exec puma -C /home/ubuntu/my_app/current/config/puma.rb (code=exited, status=1/FAILURE
 Main PID: 4316 (code=exited, status=1/FAILURE)

Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Failed with result 'exit-code'.
Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Service hold-off time over, scheduling restart.
Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Scheduled restart job, restart counter is at 10.
Dec 29 00:52:19 MyIp systemd[1]: Stopped puma-website.service.
Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Start request repeated too quickly.
Dec 29 00:52:19 MyIp systemd[1]: puma-website.service: Failed with result 'exit-code'.
Dec 29 00:52:19 MyIp systemd[1]: Failed to start puma-website.service.

来源:https://stackoverflow.com/questions/65492028/rails-6-capistrano-no-such-puma-sock-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!