The pfSense Store

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

0 Members and 1 Guest are viewing this topic.

Offline billyjp

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
502 Bad Gateway (nginx) after Update to 2.3
« on: April 21, 2016, 03:28:59 am »
Hello!

First at all the new Design since Ver. 2.3 looks great!

But since i update to this Version i have the Error "502 Bad Gateway (nginx) in the Browser if i try to connect to the Firewalls GUI. This error comes about after 3-5 days. A restart solve the problem. But this is not the best way!


Can anybody help me how to fix this problem.

THX

Offline v4rp1ng

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #1 on: April 21, 2016, 07:22:45 am »
Same here.

And now after the upgrade I get some strange errors on the webinterface (see attachment).
Already tried to reinstall the systempackages with Diagnostics > Backup & Restore > Reinstall Packages but it seems it's not functioning too.

Offline jwilling

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #2 on: April 21, 2016, 02:59:44 pm »
Also experiencing the 'Bad Gateway' issue since the update.

Occurring here almost daily and having to repeatedly reboot the system to clear it is not an acceptable option.

Offline dusan

  • Full Member
  • ***
  • Posts: 216
  • Karma: +10/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #3 on: April 21, 2016, 03:28:48 pm »
There are several threads about error 502/504 . For example, https://forum.pfsense.org/index.php?topic=110116.0

Offline cmb

  • Hero Member
  • *****
  • Posts: 11230
  • Karma: +893/-7
    • View Profile
    • Chris Buechler
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #4 on: April 21, 2016, 03:29:03 pm »
You don't have to reboot, option 16 at the console will bring it back.

Not that that's acceptable, we're working on fixing any issues there. The one most people seem to be encountering is:
https://redmine.pfsense.org/issues/6177


Offline billyjp

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #5 on: May 06, 2016, 05:19:47 am »
Thank you for this info.

Is it possible to force the option 16 ofer ssh?

When i log in my pfsense over SSH i just see the consol input window without any options to choose (1,2,3,...)

Offline Jailer

  • Sr. Member
  • ****
  • Posts: 399
  • Karma: +54/-2
    • View Profile
    • Bored Guy Blog
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #6 on: May 06, 2016, 09:19:36 am »
Thank you for this info.

Is it possible to force the option 16 ofer ssh?

When i log in my pfsense over SSH i just see the consol input window without any options to choose (1,2,3,...)

Code: [Select]
service nginx restart

Offline Den

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #7 on: May 06, 2016, 11:02:32 am »
I had the same problem on clean install of 2.3. Restarting PHP-FPM and webConfigurator didn't help, had to reboot.

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 #8 on: May 06, 2016, 01:08:17 pm »
Is it possible to force the option 16 ofer ssh?
/etc/rc.php-fpm_restart

service nginx restart
might give you: "Cannot 'restart' nginx. Set nginx_enable to YES in /etc/rc.conf or use 'onerestart' instead of 'restart'."

And "rc.restart_webgui" gives you option 11 "Restart webConfigurator" from console.
« Last Edit: May 06, 2016, 01:12:01 pm by jahonix »
Chris

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

Offline cmb

  • Hero Member
  • *****
  • Posts: 11230
  • Karma: +893/-7
    • View Profile
    • Chris Buechler
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #9 on: May 07, 2016, 02:24:02 am »
service commands don't do anything, don't run them. If you don't get the console menu, you're not logging in as root. You'll need the sudo package, then run sudo /etc/rc.initial

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 #10 on: May 07, 2016, 06:44:16 pm »
You learn something new every day.
Thanks!
Chris

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

dominic1134

  • Guest
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #11 on: May 10, 2016, 03:48:09 pm »
Disabling the automatic dashboard auto-update check at /system_update_settings.php seems to mitigate the issue for now.

edit: i'm getting more and more the feeling that the issue is somehow ipv6 related..  still investigating.
« Last Edit: May 10, 2016, 06:44:05 pm by dominic1134 »

Offline billyjp

  • Jr. Member
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #12 on: May 11, 2016, 03:19:45 am »
Thanks for this tipp.

Can anyone approve this? I dont want to change to much important on my Main Firewall. But the nginx error comes no every 3 days  :-[

Offline luckman212

  • Hero Member
  • *****
  • Posts: 726
  • Karma: +59/-0
    • View Profile
    • @luckman212 - github
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #13 on: May 18, 2016, 07:05:31 am »
Just want to chime in since I feel the 2.3.1 release is imminent

I got this 502 Bad Gateway nginx error for the first time today.  Had never seen it before.  I am actually running a 2.3.2 snapshot according to the dash, based on 2.3.1.a.20160516.0651.  I have been tracking the dev branch - Not sure how I landed on 2.3.2 but I assume that whatever fix was in for this should have been in there.  So I don't believe that this is fixed. yet.

I do have the auto-update check enabled on my dashboard.

I did leave the dashboard page "up" in a browser window overnight so I guess it was sitting there for a long time refreshing every so often.

I do have the IPSEC dashboard widget turned on, with 2 tunnels that are both "UP"

This is on an SG2440

My logs were filled to the brim with the error below:

Code: [Select]
nginx: 2016/05/18 07:54:28 [error] 50536#0: *6944 connect() to unix:/var/run/php-fpm.socket failed (61: Connection refused) while connecting to upstream, client: 2604:2000:xxxx:xx::116e, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.socket:", host: "r1.xxx.xxx:8888"

I run my webconfigurator on HTTP port 8888

Not sure if that gives any clues

Screenshot below

Offline Ambivalent

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: 502 Bad Gateway (nginx) after Update to 2.3
« Reply #14 on: May 18, 2016, 11:39:22 am »
So after having this issue multiple times a day I dug and dug and dug and found the thing that fixed it for me. This will apply to you if, like me you had been leaving the main firewal page open with the widgets. This error appears to be caused by a widget. In my case I had to close my OpenVPN status widget and it stopped killing PHP and apparently that kills the whole thing until you reboot. This may or may not apply to you but it's easy to test and not a terrible workaround for now.