Forum Discussion

Alex_Pozzan_325's avatar
Alex_Pozzan_325
Icon for Nimbostratus rankNimbostratus
Feb 27, 2009

01220001:3: TCL error: wrong # args: should bewhile executing

Hi,

 

 

I have the following iRule attached:

 

 

It's the same iRule used to jsessionid. We only change the id to LBSICAPRENDE. The application is running but sometimes LTM reports the following error:

 

 

Feb 27 14:06:53 tmm tmm[1721]: 01220001:3: TCL error: ir-persist-sicrediaprende - wrong args: should be "persist add uie | { [any [virtual|service|pool] | pool ]}" while executing "persist add uie [HTTP::cookie "LBSICAPRENDE"]"

 

 

Does anybody have any idea that is supposing to be the problem?

6 Replies

  • I would guess the app is setting the LBSICAPRENDE cookie with no value. You could add logging to see what the value of the cookie is before using it. Or you could use catch to handle the error and log debug information if there is an error:

      
     if {[catch {persist add uie [HTTP::cookie "LBSICAPRENDE"]} result]}{  
         Error adding persistence record  
        log local0. "[IP::client_addr]:[TCP::client_port]:\ 
           Error on response from [IP::server_addr] with cookie [HTTP::cookie LBSICAPRENDE]. \$result: $result."  
     }  
     

    Aaron
  • when HTTP_RESPONSE {

     

    if { [HTTP::cookie exists "LBSICAPRENDE"] and $add_persist } {

     

    persist add uie [HTTP::cookie "LBSICAPRENDE"]

     

    set add_persist 0

     

    if {[catch {persist add uie [HTTP::cookie "LBSICAPRENDE"]} result]}{

     

    log local0. "[IP::client_addr]:[TCP::client_port]: Error on response from [IP::server_addr] with cookie [HTTP::cookie LBSICAPRENDE]. \$result: $result."

     

    }

     

    }

     

    }

     

     

    It will anything like lines above?
  • Hi Aaron,

     

     

    I placed the lines but it shows nothing.

     

     

    Does anybody have any more idea?

     

     

    Alex
  • The catch command runs the command inside it. So you don't need to run it again. Can you try this?

     
     when HTTP_RESPONSE {   
        if { [HTTP::cookie exists "LBSICAPRENDE"] } {   
           if {[catch {persist add uie [HTTP::cookie "LBSICAPRENDE"]} result]}{   
              log local0. "[IP::client_addr]:[TCP::client_port]:\ 
                 Error on response from [IP::server_addr] with cookie [HTTP::cookie LBSICAPRENDE]. \$result: $result."   
           }   
        }   
     }   
     

    Also, I'm not sure why you're only adding a persistence record once per TCP connection. If multiple clients connect from behind the same proxy, they could share the same TCP connection. You'd want to set the persistence for both clients.

    Aaron
  • You're right. The problem happens because the cookie is empty. I had the following result:

     

     

    Rule ir-persist-sicrediaprende2 HTTP_RESPONSE: 10.30.8.110:1279: Error on response from 172.24.0.20 with cookie . $result: wrong args: should be persist add uie key | {key [any [virtual|service|pool] | pool name]}.

     

     

    What do you mean "share the same tcp connection"? Using OneConnect?
  • If two clients connect to the virtual server through the same proxy server (like two clients on the same corporate network or the same ISP), they could make HTTP requests over the same TCP connection. So it's not a good idea to assume that there is a one to one relationship between TCP connections and HTTP sessions.

    Can you try this version of your rule?

     
     when HTTP_REQUEST { 
        if { [string length [HTTP::cookie "LBSICAPRENDE"]] > 0 } { 
           persist uie [HTTP::cookie "LBSICAPRENDE"] 
        } else { 
           set lbsicap [findstr [HTTP::uri] "LBSICAPRENDE" 11 ";"] 
           if { $lbsicap != "" } { 
              persist uie $lbsicap 
           }  
        } 
     } 
     when HTTP_RESPONSE { 
        if { [string length [HTTP::cookie "LBSICAPRENDE"]] > 0} { 
           persist add uie [HTTP::cookie "LBSICAPRENDE"] 
        } 
     } 
      
     

    Or you could just modify the jsessionid persistence rule from the Codeshare:

    http://devcentral.f5.com/wiki/default.aspx/iRules/Weblogic_JSessionID_Persistence.html (Click here)

    Aaron

    http://devcentral.f5.com/wiki/default.aspx/iRules/Weblogic_JSessionID_Persistence.html