New 502 Bad Gateway



  • Hello,

    since yesterday I haven't had any problem.  No hickups or any breakdown.

    The script:

    truss -Haedf -s 100 -o /root/truss_pfblocker_test.log /root/testpfb.sh 1

    -> does not hang

    Question:

    What have I to apply to fix the issue? The patch that was made available via git or the fixes below:

    https://forum.pfsense.org/index.php?topic=110515.60

    Have you already commited the changes?

    Thanks,



  • the git patch commit by Martin is the the same as my patch, he just made it an easier process and we can wait for the pfsense staff to approve the commit so it makes it into a future version, but for now either apply my patch in its raw format or the use the git id Martin provided.

    As long as your unit has at least a gig of ram it should solve the problem.

    Note the patch was created on a 2.4.x unit, I am not sure how clean it will apply on 2.3.x devices, thats untested.


  • Moderator

    Thanks @chrcoluk and @marjohn56,

    Hopefully this fixes this issue once and for all…. Looking forward to users feedback!



  • @dstroot:

    I think the "Can NOT be reverted cleanly" through me off.  I just checked and mine and got the results you show so I applied the patch and it applied successfully.  I will report if the 502s go away.  Cheers!

    Reporting back - have not had any issues since the patch was applied.  Cheers!!!



  • I had a issue this morning. The only difference was that the update for pfblocker has been enabled again.
    Webgui and internal network was reachable.

    Do you run pfblocker with enabled update? How often do you update?

    Thanks,

    @dstroot:

    @dstroot:

    I think the "Can NOT be reverted cleanly" through me off.  I just checked and mine and got the results you show so I applied the patch and it applied successfully.  I will report if the 502s go away.  Cheers!

    Reporting back - have not had any issues since the patch was applied.  Cheers!!!


  • Moderator

    … and not a creature was stirring, not even a mouse...

    Any additional feedback on the PHP patch posted above would be appreciated! Thanks.



  • @BBcan177:

    … and not a creature was stirring, not even a mouse...

    Any additional feedback on the PHP patch posted above would be appreciated! Thanks.

    … The stockings were hung by the chimney with care

    You only hear when it doesn't work, not when it does.. ;)



  • Hey everyone,
    For what it's worth, I found this thread a couple weeks ago, shortly after I installed pfblockerng and configured DNSBL. I had been running my pfsense box for about a year without a single issue, but after setting up pfblockerng and DNSBL, I'd lose GUI and console mgmt access within 24 hours, the only fix being a hard reboot.
    I installed PiBa's patch (https://github.com/PiBa-NL/FreeBSD-ports/commit/1766713b26c8f388ad6e7909b2e971f7d74cdfea.patch), and my pfsense box has been running for over 10 days now without a single hiccup. Immediately after installing the patch I noticed that my memory usage dropped from about 50% of my 1GB of RAM to about 30%, and it's remained there ever since.
    I did not install chrcoluk's patch, since I didn't want to muddy the waters during my testing. It seems it wasn't needed, at least not in my case. Big thank you to PiBa and all the other folks who helped get this fixed, you guys are awesome!



  • @minterwoot:

    Hey everyone,
    For what it's worth, I found this thread a couple weeks ago, shortly after I installed pfblockerng and configured DNSBL. I had been running my pfsense box for about a year without a single issue, but after setting up pfblockerng and DNSBL, I'd lose GUI and console mgmt access within 24 hours, the only fix being a hard reboot.
    I installed PiBa's patch (https://github.com/PiBa-NL/FreeBSD-ports/commit/1766713b26c8f388ad6e7909b2e971f7d74cdfea.patch), and my pfsense box has been running for over 10 days now without a single hiccup. Immediately after installing the patch I noticed that my memory usage dropped from about 50% of my 1GB of RAM to about 30%, and it's remained there ever since.
    I did not install chrcoluk's patch, since I didn't want to muddy the waters during my testing. It seems it wasn't needed, at least not in my case. Big thank you to PiBa and all the other folks who helped get this fixed, you guys are awesome!

    I can confirm. 12 days without any problems so far!



  • Thanks for the feedback, fyi: pfBlocker 2.1.2_2 includes my patch.

    @minterwoot
    The reduced memory usage i cant really explain with the changes from my patch.. Maybe it got a bit more efficient but wouldn't expect that to be noticeable by memory usage..



  • I haven't had any issues on any of my boxes for quite a while now on pfsense 2.4.2 and the latest pfblockerng.  I was waiting long enough to say with some level of confidence that this issue appears to be resolved but I think it may finally be safe enough to actually say it.  Hopefully, that doesn't jinx me!

    Much thanks to BBCan117 and everyone else that had a hand in troubleshooting and resolving this.  pfblockng is a wonderful tool and I'm happy to be able to use it again without concern.



  • @PiBa:

    Thanks for the feedback, fyi: pfBlocker 2.1.2_2 includes my patch.

    PackageManager shows 2.1.2_1 as the latest available. When will  2.1.2_2 be available ?

    I've been running with the quick and dirty fix mentioned earlier in this thread for several weeks now without any 502 happenings . I don't want to go through all the trouble we had at three sites one more time because of the 502 problem .. I must know for sure.



  • For those running 2.4.3, seems it's already running 2.1.2_2

    Nice one!





  • I was running 2.4.2 on UFS, and decided to upgrade to ZFS with the config.xml pull.
    Prior to the upgrade, I was using maybe 40% memory, and now I am up to 70%.
    Still does what pfsense is designed to do.
    How can I help out?

    ![Screenshot from 2017-12-22 17-08-58.png](/public/imported_attachments/1/Screenshot from 2017-12-22 17-08-58.png)
    ![Screenshot from 2017-12-22 17-08-58.png_thumb](/public/imported_attachments/1/Screenshot from 2017-12-22 17-08-58.png_thumb)
    ![Screenshot from 2017-12-22 17-05-14.png](/public/imported_attachments/1/Screenshot from 2017-12-22 17-05-14.png)
    ![Screenshot from 2017-12-22 17-05-14.png_thumb](/public/imported_attachments/1/Screenshot from 2017-12-22 17-05-14.png_thumb)



  • Not sure if I should open a new thread but my firewall went sideways about an hour ago, running latest released along with PFblocker, ntopng, autoconfigbackup and openvpn.  Kids texted me that the internet was down and got home and when I tried to connect received the 502 bad gateway. I am running latest packages for those that are listed.

    I haven't pulled the logs completely yet but see this over and over  - Could not connect to /var/run/php-fpm.socket.



  • I'm still getting 502 bad gateway error's, they are not often but had my second instance in a month.  Attached file contains the debugging steps that has been requested. Restarting PHP-FPM did not resolve the issue, I had to reboot in order to correct my issues.  Would like to get this corrected since I've never had the issue in the past.

    Let me know if you have any questions.

    trouble.txt



  • I also still get the Bad Gateway error once a day or so. I will attach the log the next time it occurs.



  • next time it occurs, login to the shell and get a list of the processes running, ideally in verbose format.



  • I am, for the first time, seeing 502 Bad Gateway. Upgraded today to the latest snapshot on my SG-3100.
    I do still have internet service so I will wait a bit until someone says they have an idea.

    Restarted via console, loaded very latest snapshot and now waiting to see if the issue pops up again.

    As of 8PM, its an issue again. I guess I need to revert to a previous release and wait a bit for the snapshots.