Forum Discussion
cralston_17844
Nimbostratus
Jan 20, 2010TCL error while executing "HTTP::method"
I've been trying to clean up my /var/log/ltm errors lately, at the suggestion of F5 support. One that's been bugging me is this:
tmm tmm[1208]: 01220001:3: TCL error: IRULE_foobar - while executing "HTTP::method"
I get about a thousand of those entries a day out of hundreds of thousands of executions of the iRule.
My gut feeling is that it's an ignorable error that is generated when an HTTP request aborts or times out before the iRule runs (or finishes running), such that HTTP::method is sort of a limbo call to make.
On the other hand, I don't get any errors for any other iRules that include HTTP::method in them, even though they're not being used as frequently.
The rule in question appends a local X- header for most traffic giving some info about what sort of forwarding took place, original client IP, SSL status, etc. The sites we host use this data in varying amounts.
Here's the key part of the code:
when HTTP_REQUEST {
if { [HTTP::method] equals "TRACE" } { reject }
append headers as necessary...
}
Am I doing something wrong? Is there some way I can catch that error before it logs? Where did my other sock go?
Thanks,
-Chris
8 Replies
- hoolio
Cirrostratus
Hi Chris,when HTTP_REQUEST { Use catch to handle any error. Save the output to $result for logging of an error or use if successful. if {[catch {HTTP::method} result]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Error running HTTP::method ($result). Headers: [HTTP::request]" reject } else { if {$result eq "TRACE"}{ reject } } }
- MocoSpace_63233
Nimbostratus
I am seeing the exact same error on occasion in my iRule which does something similar: - Chris_Miller
Altostratus
Posted By MocoSpace on 08/01/2010 05:50 AM - mrintzler
Nimbostratus
Did anyone find the root cause for this error? I get the same thing. A non-descript TCL error with the HTTP::method check. The iRule runs thousands of times a day with no problem, but occasionally logs the error. - hoolio
Cirrostratus
Hi Mike,when HTTP_REQUEST { Use catch to handle any error. Save the output to $result for logging of an error or use if successful. if {[catch {HTTP::method} result]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Error running HTTP::method ($result). Headers: [HTTP::request]" reject } else { Add the rest of the code here which is triggered if the HTTP::method command succeeds Check if HTTP::method returned HEAD if {$result eq "HEAD"}{ ... } } }
- Colin_Walker_12Historic F5 AccountThe only reason I could think of the HTTP::method check failing would be that it can't find a method. Is it possible that there is non HTTP traffic passing through this VIP occasionally? That would freak the HTTP profile out and the method call could fail then.
- hoolio
Cirrostratus
Yeah, so the idea with using catch is that you could trap the error and log the request headers which have been parsed to see what's happening. I think in order for HTTP_REQUEST to trigger a request method URI and HTTP version would need to be parsed. Maybe it's an issue with garbage characters in the method field? - Colin_Walker_12Historic F5 AccountYeah, that's my thinking too Aaron, I wasn't saying not to use catch, as you obviously need to figure out what's triggering the errors, just explaining what I thought could be the root cause. I'm curious to see what's breaking things. :)
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