Forum Discussion

RomaineShultz's avatar
RomaineShultz
Icon for Nimbostratus rankNimbostratus
Jun 16, 2022

F5 Maintenance Page iRule produces ERR_CONNECTION_RESET in browser

We have an F5 LTM that uses a simple iRule that puts up a maintenance page. It has worked fine for years - until we updated from to BigIP 15.1.5.1 (from 15.1.5.0). Now when we implement the iRule, the browser usually produces an ERR_CONNECTION_RESET error. By "usually" I mean if we refresh over and over, it will occasionally work. The iRule is simple:

when HTTP_REQUEST {
   HTTP::respond 200 content \
    "<HTML><head><title>Maintenance Page</title></head><body>
     <p>This site is down for planned maintenance.
     <br>If you need further assistance, 
     please contact the Service Desk."</p>
     </body>
     </html>" "Content-Type" "text/html"
}

I did some research and found a couple of suggestions to try, but they have not helped. I believe it's something specific to the HTTP::respond content method.

This seems like a straightforward iRule. Are We missing something here? Thank you in advance.

Edited by Leslie_Hubertus to remove SEO spam. Banning the user but leaving the post up because of the helpful answers below.

8 Replies

  • Hi Romaine, 

    It seems that there is an uneven number of " in the iRule? (or is that due to copy/paste?) There is an extra " behind ...Service Desk." which may be causing issues? 

    If you are using quotes within the HTML response page, you may want to switch to using { and } for the start and finish of the HTTP::respond, this should avoid the confusion between the " entries. 

    Hope this helps. 

  • Same question was here from another user which got deleted. So here my answer again:

    You got a syntax error: Instead of using " "after the HTTP::respond Command for html code you should use { } This is also explained in the iRule documentation if you mouseover at "http::respond" in the irule editor. 

    HTTP::respond 503 content {
    <html>
    PUT UR CODE HERE
    </html>
    }

     

  • Hi,

    How can we automate this F5 Maintenance Page configuration during a planned outage pls?

    thanks

    • AlexBCT's avatar
      AlexBCT
      Icon for Cumulonimbus rankCumulonimbus

      Do you mean how the maintenance page can be automatically triggered during an outage, or how to deploy the configuration for the maintenance page automatically? 

      In the first case, you could for example do it using the Fallback Host option in an HTTP profile, which then redirects to a virtual server with something like the above iRule attached to it. In the second case, you are able to do it using iControl.

      If you tell me which one you are looking for, happy to give you some further information. 

       

      • enthuguy's avatar
        enthuguy
        Icon for Nimbostratus rankNimbostratus

        Thanks Alex!

        If you could guide me in both the scenarios, that would be a great help

        Please note, I'm new to F5 but since I'm part of automation team would like to assist my team to automate these manual steps we follow right now.

        Current process that we follow:

        1. Just before outage 
        2. From F5 Console, Identify the current iRule configured, make a note
        3. We update the iRule with outage page related rule.
        4. Once implementation is over
        5. Update iRule back with Step2 rules.

        Intended automation

        1. Automation script should get the LB name as an argument
        2. Perform above current process steps 2 and 3
        3. Once implementation is over
        4. Will rollback the change

        Thanks in advance