Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 Bad Gateway nginx for rutorrent and dashboard #199

Closed
libinmath3w opened this issue Apr 12, 2019 · 8 comments
Closed

502 Bad Gateway nginx for rutorrent and dashboard #199

libinmath3w opened this issue Apr 12, 2019 · 8 comments

Comments

@libinmath3w
Copy link

most of the time it shows 502 Bad Gateway nginx in rutorrent and dashboard. I get a "502 Bad Gateway
nginx" error at example.com

please fix this issue

thank you

@liaralabs
Copy link
Member

liaralabs commented Apr 12, 2019 via email

@libinmath3w
Copy link
Author

libinmath3w commented Apr 13, 2019

os : ubuntu 18
Rutorrent : latest build installed.

error log

2019/04/13 07:09:14 [error] 897#897: *4319 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 46.166.143.103, server: example.com, request: "GET /rutorrent/plugins/autodl-irssi/getlines.php?cid=1378397101&_=1555130075033 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "88.154.210.77", referrer: "https://88.154.210.77/rutorrent/"

2019/04/13 07:09:31 [error] 897#897: *4587 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 107.143.101.77, server: example.com, request: "GET /?act=rt&callback=jQuery2140056982246010710336_1555014151374&_=1555014234711 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "88.154.210.77", referrer: "https://88.154.210.77/"

2019/04/12 23:30:28 [error] 872#872: *40178 connect() to unix:/run/php/php7.2-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 107.143.101.77, server: example.com, request: "GET /widgets/cpu.php?_=1555014199036 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "88.154.210.77", referrer: "https://88.154.210.77/"

@liaralabs
Copy link
Member

Sorry for not getting back to this sooner. I've been traveling and haven't been near my laptop for any extended periods for a couple weeks.

I can't replicate this on a fresh installation of swizzin on 18.04 with the vultr template.

The last line of the log you sent me appears to be the most telling

connect() to unix:/run/php/php7.2-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

Assuming you haven't altered the php versions running on your server at all, is php7.2-fpm.service running? systemctl status php7.2-fpm

nginx can't find the socket file it's been directed to in the configuration, so it either doesn't exist (perhaps the pool config has changed) or the service itself isn't running (and the socket will be created when the service is started).

@libinmath3w
Copy link
Author

it not occurring every time but but some time it shows. then it only show 502 Bad Gateway nginx.
in that server we have 10 clients they access same time.

@liaralabs
Copy link
Member

liaralabs commented Apr 30, 2019 via email

@liaralabs
Copy link
Member

Closing due to inactivity and lack of update

@Wyall
Copy link
Contributor

Wyall commented Jul 26, 2019

I had this same problem a few times now. Server restart this morning didn't help. I just checked the php7.2-fpm service and it was inactive. Starting it fixed the problem for now.

Can I help you in any way regarding this? Any specific logs? Probably the next time it happens or from which time?

@liaralabs
Copy link
Member

This is a totally different issue than the one faced by the user here.

There was a temporary conflict that's been resolved in the php detection scripts now. If you had php7.2 on your system, the logic was accidentally disabling this version rather than keeping it enabled.

sudo systemctl enable php7.2-fpm will ensure the php process is started during boot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants