Forum Discussion

sagar33_370912's avatar
sagar33_370912
Icon for Nimbostratus rankNimbostratus
Aug 30, 2018

TCl error

Hi All,

Wanted to know why i am getting this error again and again?

TCL error: /Common/iRule_https_redirect_301 - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]"

Below is current Irule:

iRule_https_redirect_301

iRule_https_redirect_301

when HTTP_REQUEST {

   HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]

}

7 Replies

  • Presumably something else is doing a redirect or response. Are there other iRules assigned or something in the http profile?

     

  • Hi Sagar,

    The problem is that you don't condition your redirect/respond. You have to condition it, example:

    when HTTP_REQUEST {
    
    if {[HTTP::uri] starts_with "/redirect"} {
        HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]
    }
    }
    

    So you have ton condition your respond or you will trigged it to each request.

    regards,

  • Yes, earlier two irlues were there but both of them were assigned to different virtual servers.

     

  • OK, are there any other iRules assigned to this virtual server? Can you post the config or maybe PM me an iHealth link?

     

  • The issue is that there are multiple iRules running on the virtual server. These will all be run for each request and there are multiple redirects and responses which are causing clashes. The long-term answer is to review these, move them to a single iRule or preferably LTM policy which is easier to manage. In the short term, you can stop the further iRules from being triggered by using

    event disable all
    after the redirect command.

    eg

    when HTTP_REQUEST {
        HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]
        event disable all
    }