Netgate SG-1000 microFirewall

Author Topic: 502 Bad Gateway (nginx) after Update to 2.3  (Read 22072 times)

0 Members and 1 Guest are viewing this topic.

Offline luckman212

  • Hero Member
  • *****
  • Posts: 726
  • Karma: +59/-0
    • View Profile
    • @luckman212 - github
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #15 on: May 18, 2016, 12:12:57 pm »
I think the IPSec widget also causes this.  Not sure why that is.  Interesting info- not really a fix but it's a workaround.  Sadly, at least for me those 2 widgets are among the most useful ones to see at a glance.

Offline phil.davis

  • Hero Member
  • *****
  • Posts: 4612
  • Karma: +551/-3
    • View Profile
    • International Nepal Fellowship
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #16 on: May 18, 2016, 09:38:08 pm »
Make sure to retry all the widgets after upgrading to 2.3.1-RELEASE.
Then this can move forward if there are more issues reported.
The problems are related to the widgets doing updates every 10 seconds or so, asking the nginx server to do stuff. nginx gives the PHP to back-end PHP processes to do the work. If those things get delayed (or hung) too much then all the PHP processes get busy and nginx will have to give up.
As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

Offline Christos

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #17 on: May 20, 2016, 01:22:03 am »
Got the 502 Bad Gateway error with 2.3.1  :( :( :(

Offline gordc

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +1/-1
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #18 on: May 26, 2016, 08:21:20 am »
Has anyone been able to figure out what is happening with this.  I get this every couple of days and the only resolution is to take the 20 minute walk to physically restart the firewall. 
I can log in using ssh but the majority of the commands either give an error on execution or don't work.  When I log in I don't get a menu.  I start the menu with /etc/rc.initial
After that if I use options 11 or 16 I get errors
Restarting webConfigurator...Error: cannot open /var/etc/nginx-webConfigurator.conf in system_generate_nginx_config().

Fatal error: Call to undefined function pfSense_interface_listget() in /etc/inc/interfaces.inc on line 80
PHP ERROR: Type: 1, File: /etc/inc/interfaces.inc, Line: 80, Message: Call to undefined function pfSense_interface_listget()
Fatal error: Call to undefined function gettext() in /etc/inc/rrd.inc on line 60
PHP ERROR: Type: 1, File: /etc/inc/rrd.inc, Line: 60, Message: Call to undefined function gettext()

>>> Killing php-fpm
pkill: signalling pid 737: Operation not permitted
/etc/rc.php-fpm_restart: cannot create /tmp/php_errors.txt: Permission denied
>>> Found XMLRPC lock. Removing.
rm: /tmp/xmlrpc.lock: Operation not permitted
>>> Starting php-fpm
[ERROR] unable to bind listening socket for address '/var/run/php-fpm.socket': Address already in use (48)
[ERROR] FPM initialization failed

If I use option 5 to try to restart the system I get the prompt asking me to continue but the system does not reboot.

I have also tried /etc/rc.initial.reboot
Again I get the prompt asking to proceed but the system does not reboot.

This is costing me too much time.

Offline jahonix

  • Hero Member
  • *****
  • Posts: 2444
  • Karma: +146/-14
  • volunteer since 2006
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #19 on: May 26, 2016, 12:49:45 pm »
Just upgrade to 2.3.1_1 which was released today.
Chris

The issue with IPv6 jokes is that almost no one understands them and no one is using them yet.

Offline Honest Bob

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #20 on: May 26, 2016, 08:16:43 pm »
I had the same issue even with 2.3.1-1. I dont have the openvpn widget open. I shut down the PFblockerNG and Snort widgets to see if they are the culprit. I am left with system information and interfaces. 

Offline samham

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #21 on: May 29, 2016, 06:15:07 am »
since upgrading from 2.2 to 2.3.1 I've been getting "502 Bad Gateway" error at least once a week which I correct by starting PHP-FPM, but this is getting very annoying especially because it causes some of my sessions to drop, does any one know of any permanent fix?

2.3.1-RELEASE-p1
IPsec
OPenVPN
PfBlockerNG

Offline Perforado

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +9/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #22 on: May 29, 2016, 03:49:49 pm »
Same here. Will try tomorrow without the ipsec widget for reference.

Offline tweek

  • Jr. Member
  • **
  • Posts: 31
  • Karma: +1/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #23 on: June 02, 2016, 06:19:31 am »
I'm also seeing the 502 Bad Gateway error. I'm running 2.3.1-RELEASE-p1 (i386 nanobsd) as a direct update from v 2.2.6, hardware is a Soekris net6501. Installed packages are Network UPS Tools v2.3.0 and openvpn-client-export v1.3.8.

When it hangs up I log in via SSH and choose the 16) Restart PHP-FPM item from the text interface. As per others on this and other threads I have removed the IPsec widget from the dashboard to see if that helps.
« Last Edit: June 02, 2016, 06:26:18 am by tweek »

Offline hekmel

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #24 on: June 06, 2016, 06:21:30 am »
I have received the 502 Bad Gateway error after upgrading to 2.3.1 Release.
I have the IPSec widget open. I will have to restart the firewall after working hours today, and disable the widget and see if that solves anything on our end.

Offline gordc

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +1/-1
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #25 on: June 06, 2016, 02:07:05 pm »
I am still getting this error even after upgrading to 2.3.1_1
It has happened a couple of times now.  I have also noticed that when it happens and I SSH in to the CLI I have to run sudo rc.initial to get the menu up.  (If I don't run sudo none of the commands will work).  I can then reset PHP and get access.

Offline phil.davis

  • Hero Member
  • *****
  • Posts: 4612
  • Karma: +551/-3
    • View Profile
    • International Nepal Fellowship
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #26 on: June 07, 2016, 12:35:02 am »
I am still getting this error even after upgrading to 2.3.1_1
It has happened a couple of times now.  I have also noticed that when it happens and I SSH in to the CLI I have to run sudo rc.initial to get the menu up.  (If I don't run sudo none of the commands will work).  I can then reset PHP and get access.
If you SSH and login as an ordinary user (not root), then the menu is not displayed - that is normal. As you say, you have to sudo (to become root) and run the rc.initial script (the menu).
As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

Offline gordc

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +1/-1
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #27 on: June 07, 2016, 12:08:51 pm »
OK.  But how about the 502 error.   It was my understanding that 2.3.1_1 was supposed to fix that problem

Offline phil.davis

  • Hero Member
  • *****
  • Posts: 4612
  • Karma: +551/-3
    • View Profile
    • International Nepal Fellowship
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #28 on: June 07, 2016, 08:31:29 pm »
OK.  But how about the 502 error.   It was my understanding that 2.3.1_1 was supposed to fix that problem
I believe there are still possibly some cases where the IPsec widget is doing back-end requests, those hang (or take a long time) and make all the PHP processes busy.
If you have the IPsec widget enabled on the dashboard, then remove it. Report back if that stops the problem.
As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

Offline hekmel

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #29 on: June 08, 2016, 04:56:04 am »
I have received the 502 Bad Gateway error after upgrading to 2.3.1 Release.
I have the IPSec widget open. I will have to restart the firewall after working hours today, and disable the widget and see if that solves anything on our end.

After restart I have disabled the IPsec widget and the error has stayed away. Lets hope it continues to stay away