darragh_19954
Nov 09, 2007Nimbostratus
TCL runtime error with persist lookup
Hi,
We are using an iRule to manage users between 2 pools of servers, based on various bespoke rules.
When the requests are from cookie-enabled clients, we can successfully use cookies to keep the session (& repeat visits) sticky to a particular pool.
However, if the user has cookies-disabled, we're trying to use a Universal Persistance rule based on the IP/UA combination to keep the session sticky to a pool.
Here's the code in it's simpliest format that I can't get to work:
when HTTP_REQUEST {
construct the ID to use for persistence
set id "[IP::client_addr][HTTP::header User-Agent]"
look up this ID in persistence table (this fails)
set persistInfo [persist lookup uie id]
do lots of stuff based on results
...
persist on this id for future requests
persist uie id 300
go to a particular pool
pool poolA
return
}
The page fails to direct to either pool and the error message in the log is:
TCL error: Rule AB_test_rule1 HTTP_REQUEST - Prerequisite operation not in progress line 1 invoked from within persist lookup uie id
Any thoughts?
The only way I can avoid this failure is if I use a lookup statement like this:
set persistInfo [persist lookup uie {id pool poolA}]
but my understanding is this will only lookup poolA? However, while the id does get saved to the persistence tables, it never returns a value upon repeat requests.
I'm stumped.
Does anyone know any solutions to this or a page of decent examples of [persist] in action within iRules?
thanks a million
darragh