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

    New 502 Bad Gateway

    2.4 Development Snapshots
    67
    281
    197.1k
    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.
    • F
      fraglord
      last edited by

      @BBcan177:

      As per jimp's suggestion, please try these two patched files which use a pfSense function called try_lock() as opposed to flock().

      Run the following commands to download the patched version of the two files from my Github Gist:

      fetch -o /usr/local/www/pfblockerng/www/index.php "https://gist.githubusercontent.com/BBcan177/9f9c8e62b166cee07ad16cd4ff59103c/raw"
      fetch -o /usr/local/pkg/pfblockerng/pfblockerng.inc "https://gist.githubusercontent.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/raw"
      

      Recommend a reboot after downloading the patches.

      You can review the Gist revisions here:

      index.php
          https://gist.github.com/BBcan177/9f9c8e62b166cee07ad16cd4ff59103c/revisions

      pfblockerng.inc
          https://gist.github.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/revisions

      Note: The try_lock() function calls might require increasing the timeout setting from the default setting of "5" (seconds)

      So Far running for more than 24 hrs without problems on pfsense 2.4.0 - I would say it looks pretty good.

      I will upgrade to pfsense 2.4.1 tonight.

      pfSense 2.4.0 (amd64) running on IGEL H710C | 1G RAM | 8G SSD | INTEL PRO/1000 PT Dual NIC

      1 Reply Last reply Reply Quote 0
      • J
        justsomeguy6575
        last edited by

        I haven't posted here but have been following the thread as I've had similar issues. After so many hours(less than half a day) pfsense gui and shell would become completely unresponsive even though clients still had internet access.

        Replacing the files "index.php" and "pfblockerng.inc" with the ones BBcan177 posted seems to have fixed the issue for me. I've been up for 41hrs now without a problem.

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

          Guess I spoke too soon. Just got the 502.  Also this seems to stop the firewall schedules from working as a schedule that was allowing access should have been stopped but access was still available.  Hopefully it's not affecting other aspects of the firewall security.

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

            Is 2.4.1 supposed to fix this without the updated files here?

            I saw the redmine ticket was closed due to a new version of pfbng fixing this. Is that automatically installed in 2.4.1? I'm not seeing a package update on my 2.4.1 RELEASE box.

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

              If you ran the 2.4.1 update after the new package was uploaded (2.1.2_1) then it would pick up the new files automatically.

              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
              • N
                ntct
                last edited by

                I still have 502 issue when use pfSense 2.4.1 and pfblockerng 2.1.2_1.  :(

                output.txt

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

                  Still having the issue after 2.4.1, had to disable DNSBL again.

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

                    Hey all,

                    Try disabling the Dashboard auto-update check. It seems unrelated, but I made this change last weekend and my system has been stable ever since.

                    1 Reply Last reply Reply Quote 0
                    • kklouzalK
                      kklouzal
                      last edited by

                      I am also experiencing this issue. Error 502 Bad Gateway roughly every 15 hours. Latest version of pfSense and pfBlocker as of the date of this post. I'd post the actual versions but I need to reboot the router to get into the GUI and I can't afford to take down the internet here at this very moment.

                      As a side note, I've used pfSense for years now and this '502 Bad Gateway' seems to be a reoccurring theme..

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

                        Running 2.4.1 and 2.1.2_1 and still getting 502 but also getting a few crash reports to send in each day as well.

                        PHP ERROR: Type: 1, File: /usr/local/pkg/pfblockerng/pfblockerng.inc, Line: 2496, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 8192 bytes)	@ 2017-10-28 07:02:39
                        
                        1 Reply Last reply Reply Quote 0
                        • D
                          D-Kun
                          last edited by

                          Hi,

                          same here - updates onto last version of pfsene & pfblocker - after about a day it becomes unresponsive.

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

                            Disabling Snort and it's updates has kept me up and running for 2 days now.  I'm going to wait another day and then re-enable snort and see what happens.  Perhaps Snort needs the same changes that pfblocker has gotten.

                            1 Reply Last reply Reply Quote 0
                            • BBcan177B
                              BBcan177 Moderator
                              last edited by

                              I made some additional mods to the code.  Run the following command to download the patched version from my Github Gist:

                              fetch -o /usr/local/pkg/pfblockerng/pfblockerng.inc "https://gist.githubusercontent.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/raw"
                              

                              Recommend a reboot after downloading the patch.

                              Please let me know your feedback!

                              "Experience is something you don't get until just after you need it."

                              Website: http://pfBlockerNG.com
                              Twitter: @BBcan177  #pfBlockerNG
                              Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                              1 Reply Last reply Reply Quote 0
                              • H
                                ha11oga11o
                                last edited by

                                For me after  2.4.1-RELEASE (amd64)  and pfBlockerNG 2.1.2_1 Finally no more err 502 or 504. Open VPN keep connections.

                                Sistem running for  2 Days 09 Hours 02 Minutes 23 Seconds. Before i had issues after 6-9 hrs.

                                Many thnx fo all.

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

                                  @mindframe:

                                  Hey all,

                                  Try disabling the Dashboard auto-update check. It seems unrelated, but I made this change last weekend and my system has been stable ever since.

                                  Well it finally failed after a week of being stable…

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

                                    @BBcan177:

                                    I made some additional mods to the code.  Run the following command to download the patched version from my Github Gist:

                                    fetch -o /usr/local/pkg/pfblockerng/pfblockerng.inc "https://gist.githubusercontent.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/raw"
                                    

                                    Recommend a reboot after downloading the patch.

                                    Please let me know your feedback!

                                    I installed this today and after 6 hours of running my pFsense VM increased disk usage of over 20gb and crashed the VM and needed to be rebuilt.

                                    1 Reply Last reply Reply Quote 0
                                    • BBcan177B
                                      BBcan177 Moderator
                                      last edited by

                                      @morph0:

                                      I installed this today and after 6 hours of running my pFsense VM increased disk usage of over 20gb and crashed the VM and needed to be rebuilt.

                                      I don't think the patch would have done that… Confirmed with a few other users. Check your PM for details and we can go from there... Thanks!

                                      "Experience is something you don't get until just after you need it."

                                      Website: http://pfBlockerNG.com
                                      Twitter: @BBcan177  #pfBlockerNG
                                      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

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

                                        @morph0:

                                        @BBcan177:

                                        I made some additional mods to the code.  Run the following command to download the patched version from my Github Gist:

                                        fetch -o /usr/local/pkg/pfblockerng/pfblockerng.inc "https://gist.githubusercontent.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/raw"
                                        

                                        Recommend a reboot after downloading the patch.

                                        Please let me know your feedback!

                                        I installed this today and after 6 hours of running my pFsense VM increased disk usage of over 20gb and crashed the VM and needed to be rebuilt.

                                        Works on my machines since 4 days without a hassle and without filling up the disks.
                                        What was filled up, did you have had a look on the files?

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

                                          @seraphyn:

                                          @morph0:

                                          @BBcan177:

                                          I made some additional mods to the code.  Run the following command to download the patched version from my Github Gist:

                                          fetch -o /usr/local/pkg/pfblockerng/pfblockerng.inc "https://gist.githubusercontent.com/BBcan177/7ff15715be0f02afdbe0a00c676aedce/raw"
                                          

                                          Recommend a reboot after downloading the patch.

                                          Please let me know your feedback!

                                          I installed this today and after 6 hours of running my pFsense VM increased disk usage of over 20gb and crashed the VM and needed to be rebuilt.

                                          Works on my machines since 4 days without a hassle and without filling up the disks.
                                          What was filled up, did you have had a look on the files?

                                          I checked BBcan's pm and started the process again and keeping check on a few things this time. I couldn't check when it happened though as it had reached 109% storage and the VM crashed and when I rebooted it, it took everything with it. Configs for all services where 95% lost (like 3 DHCP mappings remained of a list of 200+, lost all NAT/Rules). So I ended up just factory resetting and am now attempting to replicate the findings. I will keep everyone updated as the day progresses.

                                          1 Reply Last reply Reply Quote 0
                                          • G
                                            gsmornot
                                            last edited by

                                            2.4.1-RELEASE (amd64)  and pfBlockerNG 2.1.2_1 which has been just fine until this morning. I now get the 502 bad gateway again. I installed the two patch files as well prior to the update to 2.1.2_1. I don't know when I lost access since the system will continue to run but I think I looked at the GUI yesterday.

                                            I just installed the most recent change from the previous page so ignore this until I have more time to keep an eye on it. I read past the 3rd file thinking it was one of the previous files.

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