<HTTP_REQUEST> - Operation not supported. Multiple redirect/respond invocations not allowed (line 5) invoked from within "HTTP::respond 200

testirule :

when CLIENT_ACCEPTED {

set hsl [HSL::open -proto UDP -pool xyz-pool]

}

when HTTP_REQUEST {

if {[HTTP::uri] starts_with “/testme”} {

HSL::send $hsl “MyTest [IP::local_addr] [HTTP::uri]”

}

else {

HTTP::respond 200 content “”

}

}

errors in log:

Nov 20 07:57:08 slot2/tmm1 err tmm1[5251]: 01220001:3: TCL error:testirule - Operation not supported. Multiple redirect/respond invocations not allowed (line 5) invoked from within “HTTP::respond 200 content “””

expert,why there is error in logs

what is the possiblity to generate this log

thx in advance

Please ensure you don’t have any HTTP Classes assigned to the Virtual Server. If you don’t, try this, which I’ve only tweaked slightly;

when CLIENT_ACCEPTED {
    set hsl [HSL::open -proto UDP -pool xyz-pool]
}   
when HTTP_REQUEST {
 if { [HTTP::uri] starts_with "/testme" } {
  HSL::send $hsl "MyTest [IP::local_addr] [HTTP::uri]"
  return
  }
 else {
  HTTP::respond 200 content "Something" noserver Content-Type "text/html" Connection "Close"
  }
}

I thought perhaps not putting any content in the quotes “” after ‘200 content’ might be it but my test VE takes it just fine. Do you have more than one iRule assigned to the VS perhaps? Regardless, the error is stating that you have configured multiple redirects or responses in the rule (which would be a problem) but you clearly haven’t, hence my queries about HTTP Classes and additional iRules.

Also, what version are you running please?

You can only send a redirect or HTTP response once per HTTP request. Trying to do more than one redirect or response will trigger this TCL runtime error.

Do you have other iRules enabled on the virtual server? If so, can you post the other iRule(s)?

aaron

oh,steve

sorry for the wrong info I provided

there is another irule above this irule

when HTTP_REQUEST {

HTTP::respond 200 content {

xxxxx.

}

}

it seems this is the root cause

No problem. Let us know if you need any help combining the two to overcome the error. Cheers

when this error shows,it means both redirect /respond will not work,right?

Correct, the two are mutually exclusive, you can’t redirect the client elsewhere and then provide some content. Equally, you can’t redirect twice or respond twice.