Forum Discussion
Brandon_High_10
Nimbostratus
Nov 22, 2004"Multiple method invocations not allowed" error
I'm getting a strange error in /var/log/ltm. It doesn't seem to affect anything, but I'm still concerned about the entries.
A pseudo-summary:
when HTTP_REQUEST {
set host "[HTTP::host]"
if { [string first "." ${host}] < 0 } {
set host "[HTTP::host].domain.com"
HTTP::redirect "http://${host}[HTTP::uri]"
}
( blah, blah, blah )
if { [HTTP::path] starts_with "/foo"} {
pool portal
}
else {
HTTP::redirect "http://${host}/foo/bar/baz"
}
}
The log entries look like:
Nov 22 15:48:19 tmm tmm[662]: 01220001:3: TCL error: Rule gwiz-qa - Operation not supported. Multiple method invocations not allowed (line 1) invoked from within "HTTP::redirect "http://${host}/foo/bar/baz""
Nov 22 15:48:19 tmm tmm[662]: 01220001:3: TCL error: Rule gwiz-qa - Operation not supported. Multiple method invocations not allowed (line 49) invoked from within "HTTP::redirect "http://${host}/foo/bar/baz""
2 Replies
- unRuleY_95363Historic F5 AccountFirst, the cryptic message should really read:
Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::redirect "http://${host}/foo/bar/baz"
What is happening is that your rule is first setting a HTTP::redirect because the host does not contain a ".". Then, later, you are again invoking a redirect because the path does not start with "/foo". You can only redirect once for a connection in a given rule. So, you could simply fix this by adding a "return" after the first redirect. Of course, depending on your application, you could also fix it by saving the redirect string off in a variable and then doing the redirect at the end of the rule event if the redirect variable is not empty. - Brandon_High_10
Nimbostratus
Ah, thanks. I assumed there was an implied return after a redirect, similar to the 4.5 behavior.
On a similar thread, does a "pool" command have an implied return as well, or do I need to explicitly state it?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
