• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Relation "502 Bad Gateway"/"can't apply process slot" and restart iptables?

jvkranenburg

New Pleskian
Dear,

I have a strange issue on a Plesk 12 VPS. Sometimes the sites result in a "502 Bad Gateway (nginx)". This happens 1 or 2 times a day on different times.

In the httpd log I see a record "can't apply process slot" and in nginx log I see "connect() failed (111: Connection refused) while connecting to upstream" but restarting apache and/or nginx will not always result in a working site.

When I restart iptables everything is working fine again.

Can anyone explain me the possible relation of these three regarding this error?
And, is there anyone who has a solution for the issue so this will not happen again?

Kind Regards,
Jerry

If more details are needed please let me know!!
 
Last edited:
First of all make sure that you have no failcounters for VPS resources with:

# cat /proc/user_beancounters

Maybe you have lack of VPS resources.
 
Thanks IgorG, for your quick reply!

Resources are not an issue. Our monitoring tools give a highest CPU usage of 40,9% and for memory 39%.
But ran the command you suggested and all failcounters are 0, as shown in attached file.
 

Attachments

  • Screen Shot 2015-07-08 at 10.58.34.png
    Screen Shot 2015-07-08 at 10.58.34.png
    395.8 KB · Views: 2
The first one I already did.
The second not, added the "resolver 127.0.0.1;" to the nginx.conf file.

Regenerate all domains and restarted apache and nginx.

Lets see if this is the solution!

Will keep you updated. Thanks so far!
 
After 5 days of working without problems today I had the described issue 2 times till now.

proxy_error_log:
2015/07/14 14:38:57 [error] 31724#0: *43582 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xx.xx.xxx, server: domeinname.nl, request: "GET /gereedschap-klusgereedschap-dhz-klusspullen/speciekuip-bouwemmer-speciekuipen-bouwemmers.html HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:7080/gereeds...iekuip-bouwemmer-speciekuipen-bouwemmers.html", host: "www.domainname.com"

2015/07/14 14:38:58 [error] 31724#0: *43585 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xxx.xx, server: domainname.com, request: "GET /b.html HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:7080/b.html", host: "www.domainname.com"

2015/07/14 14:38:59 [error] 31724#0: *43587 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xx.xx.xx, server: domainname.com, request: "GET /stofstop-deur-afsluitfolie-met-rits-2-5-x-1-1.html HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:7080/stofstop-deur-afsluitfolie-met-rits-2-5-x-1-1.html", host: "www.mekki.be"

All cases it seems the firewall blocks the call to http://xxx.xxx.xxx.xxx:7080.
That should be the reason it starts working again when I restart iptables.

But how can I find why iptables, sometimes block's this call? And how can I tell iptables to let calls to 7080 through?

Or maybe I'm completely wrong :)
 
Back
Top