Forum Discussion
Mike_73765
Nimbostratus
Aug 20, 2010issue with cookie persist irule
Hey guys, I am having an issue with an irule that I got from code share that is shown below. This irule is used on 2 virtual servers (using the same nodes, but different ports) and should be persistent between virtual servers. The user logs into the website, which is vs 1, and clicks a link that sends them to vs 2 (the same node). This works only sometimes for the users. The HTTP::response event in this irule always works, but the HTTP::request event gets numerous errors.
Here’s the error:
Aug 19 16:18:57 local/tmm err tmm[13657]: 01220001:3: TCL error: cookie - no such pool Failed Tcl_pool_GetFromObj: pool (line 6) invoked from within "active_members -list [LB::server pool]"
IRule:
when HTTP_REQUEST {
if { [HTTP::cookie exists "cookie"] } {
set decrypted [HTTP::cookie decrypt "cookie" "passcode"]
if { ($decrypted ne "") }
{ set persist_node [HTTP::cookie "cookie"]
foreach member [active_members -list [LB::server pool]] { <--Line that fails
set node [lindex $member 0]
if { $node eq $persist_node }
{ node $persist_node [lindex $member 1] } } }
log local0. [LB::server] } } <-- Doesn't return anything
when LB_FAILED { LB::reselect }
when HTTP_RESPONSE {
HTTP::cookie insert name "cookie" value [IP::remote_addr] path /
HTTP::cookie encrypt "cookie" "passcode" }
Thanks for your help,
Mike
24 Replies
- Chris_Miller
Altostratus
Under this line:HTTP::cookie insert name "cookie" value [IP::remote_addr] path /
Add this line:log local0. "cookie inserted with value [IP::remote_addr]"
Let me know what log entries you see in the LTM section of logging. - Chris_Miller
Altostratus
Ug...this is what I get for posting before I'm completely awake...I see you already configured logging and that you're inserting the cookie properly.
Under this line:set persist_node [HTTP::cookie "cookie"]
Add:log local0. "$persist_node set to [HTTP::cookie "cookie"]"
Let me know what that's giving you...want to make sure the cookie is coming in properly...somehow, the LB::server pool command is having issues. Can you paste the exact TCL error you're getting now? - Mike_73765
Nimbostratus
log local0. "$persist_node set to [HTTP::cookie "cookie"]" is returning this:
Aug 27 09:39:19 local/tmm1 info tmm1[13658]: Rule persist_prod : 10.10.11.252 set to 10.10.11.252
The TCL error is:
Aug 27 09:37:24 local/tmm err tmm[13657]: 01220001:3: TCL error: persist_prod - no such pool Failed Tcl_pool_GetFromObj: pool (line 1) invoked from within "active_members -list [LB::server pool]" - Chris_Miller
Altostratus
Something's definitely amiss with the lb::server pool command.
Please modify the log command as follows:
From this:log local0. "$persist_node set to [HTTP::cookie "cookie"]"
tolog local0. "persist_node is $persist_node and server pool is [LB::server pool]"
Let me know what you log... - Mike_73765
Nimbostratus
here is what is logging:
Aug 30 09:31:01 local/tmm info tmm[13657]: Rule persist_prod : persist_node is 10.10.11.252 and server pool is p_webpool
when the user initiates connection to the other vs:
Aug 30 09:32:02 local/tmm info tmm[13657]: Rule persist_prod : persist_node is 10.10.11.252 and server pool is p_Resource_8008
it looks like the node is staying persistent between pools, but it is still giving me the TCL error:
Aug 30 09:36:56 local/tmm err tmm[13657]: 01220001:3: TCL error: persist_prod - no such pool Failed Tcl_pool_GetFromObj: pool (line 1) invoked from within "active_members -list [LB::server pool]" - Chris_Miller
Altostratus
Just for kicks...please change your request event to this:when HTTP_REQUEST { If the cookie exists, connect to the IP specified in the cookie if { [HTTP::cookie exists "cookie"] } { if { ([HTTP::cookie "cookie"] ne "") } { set persist_node [HTTP::cookie "cookie"] log local0. "persist_node is $persist_node and server pool is [LB::server pool]" set current_pool [LB::server pool] foreach member [active_members -list $current_pool] { set node [lindex $member 0] if { $node eq $persist_node } { node $persist_node [lindex $member 1] } } } } }
This is less efficient as we're setting a variable for the selected pool, but I'm curious. - Mike_73765
Nimbostratus
I see the same result....it's logging the same information as my last post, but the TCL error still exists:
Aug 30 15:32:15 local/tmm1 err tmm1[13658]: 01220001:3: TCL error: Luminus_persist_prod - no such pool Failed Tcl_pool_GetFromObj: pool (line 1) invoked from within "active_members -list $current_pool" - Mike_73765
Nimbostratus
one thing i did notice in the log is that both pool members were being used, see below: (these are consecutive lines)
and in the 5th entry shown, LB::server is blank
Aug 30 15:32:14 local/tmm1 info tmm1[13658]: Rule persist_prod : persist_node is 10.10.11.252 and server pool is p_HTTPS
Aug 30 15:32:14 local/tmm1 info tmm1[13658]: Rule persist_prod : cookie value set to 10.10.11.253
Aug 30 15:32:14 local/tmm1 info tmm1[13658]: Rule persist_prod : cookie value set to 10.10.11.253
Aug 30 15:32:14 local/tmm1 info tmm1[13658]: Rule persist_prod : cookie value set to 10.10.11.252
Aug 30 15:32:15 local/tmm1 info tmm1[13658]: Rule persist_prod : persist_node is 10.10.11.252 and server pool is
Aug 30 15:32:15 local/tmm1 err tmm1[13658]: 01220001:3: TCL error: persist_prod - no such pool Failed Tcl_pool_GetFromObj: pool (line 1) invoked from within "active_members -list $current_pool" - Chris_Miller
Altostratus
Are you using OneConnect on this VS?
Very interesting that we aren't able to lookup which pool we're in...which is definitely why the error is getting triggered. - Mike_73765
Nimbostratus
no, i'm not using OneConnect in any of the virtual servers.
Any other ideas to persist across virtuals, pools, and services with this configuration? I also tried a cookie hash profile, but the connection doesn't work at all.
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
