Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    New 502 Bad Gateway

    Scheduled Pinned Locked Moved 2.4 Development Snapshots
    281 Posts 67 Posters 203.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      BreeOge
      last edited by

      I have a lot memory and diskspace available when it happens so its something else.

      Same here..

      The release notes for 11.1 are here https://www.freebsd.org/releases/11.1R/relnotes.html#kernel

      Lots of changed for the kernel.  I suspect one of these are the cause, due to it crashed the kernel but I could be wrong on that.  Also I have no idea what would cause it.  just something to look at.

      I know it looks like the system is being overloaded like doktornotor said, but hard to believe a system that never overloaded before the update now overloads constantly with the same load or less.  Does not make sense.

      1 Reply Last reply Reply Quote 0
      • luckman212L
        luckman212 LAYER 8
        last edited by

        Hmm I'm not running into any issues on my test 2.4.1 box, but to be fair, I'm not running Snort of pfBNG. Hope this doesn't turn out to be a nasty bug in the kernel that could delay 2.4.x getting out the door. Seems like every time 2.4 is about to drop something else comes up. Been 542 days since 2.3-RELEASE :)

        1 Reply Last reply Reply Quote 0
        • B
          BreeOge
          last edited by

          @luckman212:

          Hmm I'm not running into any issues on my test 2.4.1 box, but to be fair, I'm not running Snort of pfBNG. Hope this doesn't turn out to be a nasty bug in the kernel that could delay 2.4.x getting out the door. Seems like every time 2.4 is about to drop something else comes up. Been 542 days since 2.3-RELEASE :)

          Yea it is for sure related to the 11.1 Kernal, PfblockerNG, or Squidguard.  Remove one or the other (pfblockerNG, or SquidGuard) and issue does not exist.

          Did a test, I had one system working for over 24 hours, since I removed PfblockeNG and no 502, put it back in and in less than 2 hours, crash.

          I have one system with PfblockerNG installed, and squidguard disabled, no issues at all.  Enabled Squidguard, and crash in less than 2 hours.

          So the issue lies between PfblockerNG, Squidguard and the Kernal. I would suspect, but i am no expert.

          1 Reply Last reply Reply Quote 0
          • M
            MaxPF
            last edited by

            Started having the same issue since the 2.4RC switch from 11.0 to 11.1. I am running pfBlocker.

            1 Reply Last reply Reply Quote 0
            • B
              BreeOge
              last edited by

              @MaxPF:

              Started having the same issue since the 2.4RC switch from 11.0 to 11.1. I am running pfBlocker.

              Do you have Squidguard also?

              1 Reply Last reply Reply Quote 0
              • M
                MaxPF
                last edited by

                @BreeOge:

                @MaxPF:

                Started having the same issue since the 2.4RC switch from 11.0 to 11.1. I am running pfBlocker.

                Do you have Squidguard also?

                No, I don't have squidguard. It hasn't happened yet with 2.4.0.r.20171005.0827.

                1 Reply Last reply Reply Quote 0
                • B
                  BreeOge
                  last edited by

                  My system that has a SUPER low load finally 502 Bad gateway.. So that rules out anything to do with SquidGuard, it is an issue with Pfblocker, and 11.1 kernal.

                  1 Reply Last reply Reply Quote 0
                  • S
                    seanr22a
                    last edited by

                    @BreeOge:

                    My system that has a SUPER low load finally 502 Bad gateway.. So that rules out anything to do with SquidGuard, it is an issue with Pfblocker, and 11.1 kernal.

                    I got my 502 problems sorted out but not in the way I want …

                    FW1: SG-2440 4Gb memory, 20Gb disk running 2.4.0.r.20171006.2203 - Snort, PFblocker, Squid
                    FW2: SG-2440 4Gb memory, 20Gb disk running 2.4.0.r.20171006.2203 - Snort, PFblocker, Squid
                    FW3: SG-8660 8Gb memory, 40Gb disk running 2.3.4-RELEASE-p1  - Snort, PFblocker, Squid

                    The above setup works perfect, no 502 errors. I want to run the SG-8660 on 2.4 as well but it simply don't work. I get 502 errors and after a while it stops to respond completely. I don't get any 502 errors on the SG-2440 running 2.4 and they have been up since October 6. Note that they run the same packages.

                    The SG-8660 have a 8-core CPU, more memory and disk but can't run 2.4 with these packages. This firewall have lot more users/traffic during the weeks but I did a test this weekend when the office is closed so no users/traffic - it just sits idle. It takes 3-4 hours and I get 502 error and 1-2 hours later it stops respond completely.

                    Now i reinstalled it with 2.3.4P1 and everything have been fine for two days :)

                    Only bad thing is that I use XMLRPC Sync for all packages between these firewalls (all run identical setup), one of the SG-2440 is the master and the other ones slaves. That was working with all FW on 2.4 but now there is a mix of 2.3.4 and 2.4 and XMLRPC Sync don't seem to be able to handle that.


                    Communications error occurred

                    Exception calling XMLRPC method merge_installedpackages_section #1 : Unknown method @ 2017-10-10 08:54:31
                    Exception calling XMLRPC method merge_installedpackages_section #1 : Unknown method @ 2017-10-10 08:54:32
                    Exception calling XMLRPC method exec_php #3 : Incorrect parameters passed to method: Signature permits 2 parameters but the request had 1 @ 2017-10-10 08:54:33
                    Exception calling XMLRPC method exec_php #3 : Incorrect parameters passed to method: Signature permits 2 parameters but the request had 1 @ 2017-10-10 08:54:34

                    [EDIT]
                    Forgot to write that I get the same sync error no matter if it's snort, PFblocker or squid - they all give the same error message so I don't think it have to do with the packages.

                    1 Reply Last reply Reply Quote 0
                    • B
                      BreeOge
                      last edited by

                      Its something with Pfblocker and the new 2.4.0 & 2.4.1.  2.3 works fine.  I  can uninstall pfblockerng and my systems stay up for days, weeks, even longer.. if I put pfblockerng in.. it locks in less than 12 hours.. or less.  The 502 is just a symptom of the issue, but its the symptom you notice first.  Nginix is not directly related to the issue, its the system locking up internally, and not executing commands.  Causes everything to go nuts.

                      1 Reply Last reply Reply Quote 0
                      • S
                        seanr22a
                        last edited by

                        Strange thing is that I run PFblocker on the SG-2440 boxes without issues. They have been up since I installed the 1006.2203 release …. 4 days now. Same install on the SG-8660 locks up in a couple of hours.  ???

                        1 Reply Last reply Reply Quote 0
                        • M
                          MaxPF
                          last edited by

                          Just happened again. Here are my symptoms:

                          • Web GUI inaccessible
                          • ssh and local console do no show the menu and do not accept any input
                          • external openvpn clients cannot connect (I have an inboud rule that uses an country alias created in pfblocker)

                          Everything else keeps working, internet access, outbout vpn tunnels, port forward from outside to internal servers, DNS resolver, FW rules, vlan routing, etc.

                          I just updated to the latest build and I hope this gets fixed in the final release.

                          1 Reply Last reply Reply Quote 0
                          • AhnHELA
                            AhnHEL
                            last edited by

                            I was seeing the same thing, I upgraded to the October 9th snapshot, and did a "pkg upgrade -f" at the shell prompt and all is well again.

                            Statement retracted.

                            Took a day but yes, eventually got the bad gateway again.

                            AhnHEL (Angel)

                            1 Reply Last reply Reply Quote 0
                            • B
                              BreeOge
                              last edited by

                              @seanr22a:

                              Strange thing is that I run PFblocker on the SG-2440 boxes without issues. They have been up since I installed the 1006.2203 release …. 4 days now. Same install on the SG-8660 locks up in a couple of hours.  ???

                              On the SG-2440 boxes did you do a fresh install or update, and vise versa for the SG-6880?

                              @AhnHEL:

                              I was seeing the same thing, I upgraded to the October 9th snapshot, and did a "pkg upgrade -f" at the shell prompt and all is well again.

                              I am on the 20171009.1758 and still having issues. Depending on your load will depend on how fast it takes, I have one that can run for 4 days before it locks, but I have another than locks in less than 12 hours.  I have also done the "pkg upgrade -f" and "pkg update -f" on all systems, to rule out maybe a bad file.  Still persists.

                              I hate to say it, but I am glad others are having issues.  I knew I wasn't crazy like what was suggested.  ::)

                              1 Reply Last reply Reply Quote 0
                              • P
                                PiBa
                                last edited by

                                Hi besides using pfBlocker, do (some of?) you guys also use xmlrpc feature?
                                Can you check that there are 4 active php-fpm processes 'running' ?

                                I found that if i sync pfSense settings several times in a period of a few seconds then sometimes the sync process bails out as soon as it needs to 'print' some output, adding ignore_user_abort and setting no time limit should allow it to always finish and remove the placed lock file..

                                Maybe some of you can try if this patch can solve/reduce some of these issues?: https://github.com/pfsense/pfsense/pull/3848
                                To apply it, either add the 2 lines manually to the changed file /usr/local/www/xmlrpc.php or apply it through patches package..

                                1 Reply Last reply Reply Quote 0
                                • B
                                  BreeOge
                                  last edited by

                                  @PiBa:

                                  Hi besides using pfBlocker, do (some of?) you guys also use xmlrpc feature?
                                  Can you check that there are 4 active php-fpm processes 'running' ?

                                  I found that if i sync pfSense settings several times in a period of a few seconds then sometimes the sync process bails out as soon as it needs to 'print' some output, adding ignore_user_abort and setting no time limit should allow it to always finish and remove the placed lock file..

                                  Maybe some of you can try if this patch can solve/reduce some of these issues?: https://github.com/pfsense/pfsense/pull/3848
                                  To apply it, either add the 2 lines manually to the changed file /usr/local/www/xmlrpc.php or apply it through patches package..

                                  I dont use the xmlrpc feature on any of my boxes..  I don't know if the other guys do, they may..

                                  1 Reply Last reply Reply Quote 0
                                  • ?
                                    A Former User
                                    last edited by

                                    Having the same issue here. I've even tried using "pkg upgrade -f" in the shell but nothing. I can sign in as a user an execute commands at user level no problem but as admin I'll get stuck with the command screen unable to load as everyone else has a problem with. Shutdown won't even commence and I have to do a forced shutdown in order to restart. I'm on the latest build on my home box but I have another box with this issue running on the weekend release. Removed squid/squidguard, I'm also not using xmlrpc feature but am using pfBlockerNG.

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      seanr22a
                                      last edited by

                                      @BreeOge:

                                      On the SG-2440 boxes did you do a fresh install or update, and vise versa for the SG-6880?

                                      All three came from 2.3.4-RELEASE-p1. I de-installed all packages on all three, upgraded to 2.4 and installed the packages again. I only have 502 problems with the SG-8860. Now when the 8660 is downgraded to 2.3.4-RELEASE-p1 I have problems with the XMLRPC Sync because of the mixed 2.4 and 2.3.4 setup.

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        doktornotor Banned
                                        last edited by

                                        https://redmine.pfsense.org/issues/7923

                                        1 Reply Last reply Reply Quote 0
                                        • B
                                          BreeOge
                                          last edited by

                                          @doktornotor:

                                          https://redmine.pfsense.org/issues/7923

                                          Thank you sir.

                                          1 Reply Last reply Reply Quote 0
                                          • jimpJ
                                            jimp Rebel Alliance Developer Netgate
                                            last edited by

                                            The bug report and the thread here are bit unclear and contradictory now.

                                            Is this happening on current 2.4.0 snapshots or only 2.4.1?

                                            What error messages are in the system log, if any, when it happens?

                                            Does it only happen with pfBlocker installed, or is there some other way to trigger it? Captive Portal, perhaps? Does it require using a specific pfBlocker feature like DNSBL?

                                            If it's the max connections error, increasing kern.ipc.soacceptqueue should fix it (somaxconn no longer exists, it has a convenience alias but using it is quirky)

                                            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                            Need help fast? Netgate Global Support!

                                            Do not Chat/PM for help!

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.