Forum Discussion
darragh_19954
Nimbostratus
Nov 09, 2007TCL 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
- spark_86682Historic F5 AccountHi! Looking at your config, two things jump out at me here. First, the most common cause of the "Prerequisite operation not in progress" error from the session or persist commands is not having a default pool assigned to the VIP that this iRule is assigned to. Do you have a default pool assigned? If not, try adding it. Second, I think the line up there should read:
set persistInfo [persist lookup uie $id]
- darragh_19954
Nimbostratus
Can't believe I missed the $! Thanks for that rather obvious one ... - darragh_19954
Nimbostratus
Thanks to the help above and some more scurrying around, we got it working. Here's how it was done:
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