cancel
Showing results for 
Search instead for 
Did you mean: 

operation not supported irule error

trx_94323
Nimbostratus
Nimbostratus

Hello Community,

 

I have this issue when having a 301 redirect, I get this error below:

 

TCL error: /Common/portal_url_erp_masking_v4_TRX_PROD - Operation not supported. Multiple redirect/respond invocations not allowed (line 292) invoked from within "HTTP::respond 301 Location "http://$host/erp/""

 

One, should I be worried about this error and two, how do I get rid of it?

 

Current IRules that causes this error:

 

.......

 

elseif { ([string tolower $uri] starts_with "/portal/system") or ([string tolower $uri] starts_with "/portal/console") or

 

([string tolower $uri] equals "/") } {

 

 

redirect to erp homepage user is trying to get to the admin console

 

 

HTTP::respond 301 Location "http://$host/erp/"

 

 

return

 

 

}

 

...

 

 

Thanks in advance.

 

 

TRX

 

9 REPLIES 9

What_Lies_Bene1
Cirrostratus
Cirrostratus

Looks like you have a very long iRule in place (and possibly other rules assigned to the VS?). I'd suggest you check for any earlier (or later) redirect or respond commands that might match a particular connection more than once. Rather than use 'return' check the logic and flow of the rule to ensure there will only be one match (with no return commands used).

 

Happy to help if you are prepared to post the entire rule (suitably redacted).

 

nitass
F5 Employee
F5 Employee
it seems okay to me. by the way, you may consider replacing some switch and if with class command and data group.

 

 

class

 

https://devcentral.f5.com/wiki/iRules.class.ashx

Kevin_Stewart
F5 Employee
F5 Employee
It's an anomalous behavior, but you cannot have multiple redirect/respond invocations in a single event. There may be multiple conditions that are proving true. I would suggest two solutions:

 

 

1. As Nitass stated, dumping all of those URIs and URI patterns into a datagroup or two will make your code WAY easier to read and manage.

 

 

2. Set a variable at the true conditions, instead of the HTTP::respond, and have a single HTTP::respond at the end that uses the variable.

 

trx
Nimbostratus
Nimbostratus

Thanks I will give it a try and see if the errors go away. I''ll keep you guys posted.

 

trx
Nimbostratus
Nimbostratus

Just checking in on this. Any thoughts community?

 

Thanks!

 

Kevin_Stewart
F5 Employee
F5 Employee

The idea for option 2 was to set a variable and then act on it once. So for example:

 

when HTTP_REQUEST { if { some condition } { set redir "/foo" } elseif { some other condition } { set redir "/bar" } ... if { [info exists redir] } { HTTP::respond 301 $redir } }

trx
Nimbostratus
Nimbostratus

Thanks. I'm have to revisit this later and let you know my results.

 

trx
Nimbostratus
Nimbostratus

Question.. if I have multiple Irules and use the "return" at the end of each http request event will that cause problems? Should I even be using the "return" key?

 

Thnaks.

 

nitass
F5 Employee
F5 Employee

if I have multiple Irules and use the "return" at the end of each http request event will that cause problems?

 

return will exit from current executing event. other event is still triggered.

 

return

 

https://devcentral.f5.com/wiki/iRules.return.ashx