• I am getting Crash report on Dashboard 2-3 times within hour related to Captive Portal. Any solution ? Current system is 2.5.0.a.20201215.1520 also getting NGINX bad gateway error 502 again and again.

    PHP Errors:
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Missing boundary in multipart/form-data POST data in Unknown on line 0
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Cannot modify header information - headers already sent in /usr/local/captiveportal/index.php on line 32
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Cannot modify header information - headers already sent in /usr/local/captiveportal/index.php on line 33
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Cannot modify header information - headers already sent in /usr/local/captiveportal/index.php on line 34
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Cannot modify header information - headers already sent in /usr/local/captiveportal/index.php on line 35
    [16-Dec-2020 17:45:14 Asia/Dubai] PHP Warning:  Cannot modify header information - headers already sent in /usr/local/captiveportal/index.php on line 97
    
  • Rebel Alliance

    @wazim4u hi,

    Missing boundary in multipart/form-data POST data in Unknown on line 0
    This indicate an HTML error on the login page.

    Could you confirm if you have a custom login(or error?) page, which is having a file input
    (<input type="file" > ) ....but is not setting multipart/from data ? ( <form enctype="multipart/from-data">) ?

    If yes...that's the reason for the error. Please add enctype="multipart/from-data"> to your form


  • @free4 Yes i am having Custom login & error page. and i didn't find "<input type = file> " this is my login & error code

    <form method="post" action="$PORTAL_ACTION$" class="login">
        <h1>Voucher Authentication</h1>
        <input type="text" name="auth_voucher" class="login-input" placeholder="Voucher Code" autofocus>
        <input type="submit" name="accept" value="Continue" class="login-submit">
        <p class="footer">© 2019 Campco. Powered By: <a href="https://www.ilinks.ae">iLinks</a>.</p>
       </form>
    

    and this is Error page form code

    <form method="post" action="$PORTAL_ACTION$" class="login">
        <h1>Voucher Authentication</h1>
        <p class="login-error">$PORTAL_MESSAGE$</p>
        <input type="text" name="auth_voucher" class="login-input" placeholder="Voucher Code" autofocus>
        <input type="submit" name="accept" value="Continue" class="login-submit">
        <p class="footer">© 2019 Campco. Powered By: <a href="https://www.ilinks.ae">iLinks</a>.</p>
       </form>
    

  • @wazim4u : switching to the default build in login (error) page solves the issue ?


  • @gertjan I need to test it. System in Production with 2500 Users
    do I need to add given code to login page ?

    <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
    

  • @wazim4u :
    Yep : this example is the strict minimum :

    484364de-9df5-41dc-8d45-c6887c66b0af-image.png

    Ok, if you use vouchers only you could leaving out - using a PHP "if" block ? the lines :

     <input name="auth_user" type="text">
      <input name="auth_pass" type="password">
    

    Leaving out

    <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
    

    and if you redirect logged in user 'by force' to a fixed page like

    b15cb764-c01f-41b6-8f76-34f258abf190-image.png

    might work (did test myself).

    @wazim4u said in Captive Portal Crash:

    System in Production with 2500 Users

    and

    @wazim4u said in Captive Portal Crash:

    Current system is 2.5.0.a.20201215.1520 (build from before yesterday)

    Now, that's what I would call a real problem .....
    But thanks for testing like that 👍


  • @gertjan Thanks for Guidance. I was having a lot issues with 2.4 version but since switched to 2.5-Development its going stable . I believe its risky but in production environment you can only test system features & performance real time. Only Major issue faced during captive portal production whenever lot people try to connect to system with voucher ( example disconnect all connected users ) php-fpm got crashed and Nginx gives 502 bad gateway error. I tried to tweak Nginx but it reverts back settings. Default settings seems not ready for high production environment

  • Rebel Alliance

    @wazim4u alternatively, could you try to add enctype="multipart/from-data" to your form?

    <form method="post" action="$PORTAL_ACTION$" class="login" enctype="multipart/from-data">

    It should do the job.

    I am actually wondering if it's a new bug ...


  • @wazim4u said in Captive Portal Crash:

    I tried to tweak Nginx but it reverts back settings. Default settings seems not ready for high production environment

    Don't tweek the nginix 'captive portal instance' config files for the captive portal, these :
    /var/etc/nginx-[zone ]-CaptivePortal-SSL.conf
    and
    /var/etc/nginx-[zone]-CaptivePortal.conf

    Have a look here where they are constructed :/etc/inc/system.inc : the function function system_generate_nginx_config
    As any other file, file can get overwritten when up upgrade.


  • @free4 Thanks for the input. I am testing with recent changes made in login page and error page I added these two lines to them for test as mentioned in Pfsense documentation
    https://docs.netgate.com/pfsense/en/latest/captiveportal/configuration.html#captiveportal-custompages
    These two code lines

    <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
    <input name="zone" type="hidden" value="$PORTAL_ZONE$">
    

    Since two hours no crash error so far on Dashboard. I will keep an eye for 1-2 days then try your suggestion if not fixed.

  • Rebel Alliance

    @wazim4u are you still facing this error ?

    I also have a question : would you be able to able to narrow the issue to specific navigators/OS?
    Using the time of the PHP error, you may be able to find the source IP/the login or voucher that triggered the error...and ask the associated user what browser is being used?

    I'm asking this because I would like to ensure your issue is specific to your custom HTML page, and is not a global bug

    I tried to reproduce your issue in a lab using multiple up-to-date browsers. I wasn't successful...but I may have missed something.


  • @free4 Sorry for late reply was busy with one Project. Since I added given below code to Login and Error page no error reported so far ( almost 5 days now )

    Its a labor camp having any different mobile brands like Oppo , Redmi, Apple, Samsung, HUAWEI, Honor. you just name it. I have two sites in production on 2.5-Dev since one year two only services, Load balancing & Captive Portal ( Voucher )

    <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
    <input name="zone" type="hidden" value="$PORTAL_ZONE$">
    

    current issue on both sites I am having is related to PHP-FPM repeatedly given errors appearing in syslogs

    Dec 22 22:56:14	kernel		pid 72021 (php-fpm), jid 0, uid 0: exited on signal 11 (core dumped)
    Dec 22 22:38:44	kernel		pid 58075 (php-fpm), jid 0, uid 0: exited on signal 11 (core dumped)
    Dec 22 22:38:07	kernel		pid 15969 (php-fpm), jid 0, uid 0: exited on signal 11 (core dumped)