Forum Discussion
GavinW_29074
Feb 07, 2012Nimbostratus
HTTP_RESPONSE not firing
Hi there,
I'm using the ProxyPass v10 iRule to perform some path rewriting on some of our VIP's...
However we seem to be getting some sporadic issues whereby the HTTP_RESPONSE ev...
GavinW_29074
Feb 16, 2012Nimbostratus
All
I've done some further testing this morning, and I think I may have found a possible cause...
Within the above CatchErrors rule, I'm creating 3 variables, of the format 'HTTP_X'. When I change these variables to be 'ERROR_X', the rule works as I'd expect it to, and I don't get any issues.
So I'm wondering if the 'HTTP_' prefix has some bigger meaning when the iRules are being parsed...
After identifying the above, I'd re-written the rule to use a set of shared variables which I create at the beginning of the connection. For reference, the CatchErros rule now looks like:
when RULE_INIT {
set static::CatchErrorsDebug 0
}
when HTTP_REQUEST priority 50 {
if {$static::CatchErrorsDebug == 1} { log local0. "CatchErrors HTTP Request at Priority 50:" }
set VSPool [LB::server pool]
if { [active_members $VSPool] < 1 } {
LB::detach
log local0. "Client [IP::client_addr] requested $host$uri no active nodes available."
No pool members available. Setting error flag.
set pool_error 1
return
}
if {$static::CatchErrorsDebug == 1} { log local0. "Active Pool members [active_members $VSPool] > 0. Continuing..." }
}
when HTTP_RESPONSE priority 100 {
if {$static::CatchErrorsDebug == 1} { log local0. "CatchErrors HTTP Response at Priority 100:" }
Catch Bad Application Errors and set relevant error flag
if { $method == "GET" } {
if { [HTTP::status] == 404 or [HTTP::status] == 500 or [HTTP::status] == 502 or [HTTP::status] == 503 } {
set ERROR_STATUS [HTTP::status]
log local0.info "Error encountered. Returning unavailable page. Request details: Host=$host, URI=$uri, METHOD=$method, ClientIP=$clientip VSPool=$VSPool, HTTP_Status=$ERROR_STATUS"
set response_error 1
return
}
}
}
So for now, it looks like problem solved.
I did get a courtesy call from Masimo @ F5 in London this afternoon apologies for not responding to my websupport case, and advising that someone should be looking over the weekend. So thanks for that call Masimo, and hopefully the above will prove useful for the investigating engineer.
Anybody else come across this issue though???
Cheers
Gavin
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