Forum Discussion

Raymond_Feng_97's avatar
Raymond_Feng_97
Historic F5 Account
Jul 04, 2006

bug report about tcl for bigipv9.2.3: at client_accept event can't read variable defind at rule_init event

Hi, Sir

 

What had been changed for bigip9.2.3 TCl? I found at client_accept event can't read variable defind at rule_init event. For example the below irules:

 

when RULE_INIT {

 

set aaa 100

 

log "-------- when rule_init----$aaa"

 

}

 

when CLIENT_ACCEPTED {

 

log "-------- when rule client_accepted $aaa"

 

use pool pool123

 

}

 

 

This irules can work in bigip v9.1.2, but at bigipv9.2.3 it will get error , ltm log is below:

 

 

Jul 4 17:45:17 tmm tmm[976]: 01220002:6: Rule : -------- when rule_init----100

 

Jul 4 17:46:38 tmm tmm[976]: 01220001:3: TCL error: Rule von_irules - can't read "aaa": no such variable while executing "log "-------- when rule client_accepted $aaa""

 

 

The same problem is for the global group variable , This must be BUG!! And this will cause our most irules can’t work right!

 

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Have you tried accessing the variable as $::aaa in the CLIENT_ACCEPTED event?

     

     

    Variables set in the RULE_INIT event are treated as global variables, and this could likely be a syntax problem.

     

     

    Colin
  • Raymond_Feng_97's avatar
    Raymond_Feng_97
    Historic F5 Account
    Actually, I just try some successful irules running under v9.1.1, then find these irules can't work under v9.2.3.

     

    The problem is, neither the global group class nor the user defind variables at rule_init event can be used at any other events especially CLIENT_ACCEPTED OR LB_SELECTED.

     

     

  •  

    I haven't used 9.1.1 but we have rules running in 9.2.3 which have no problems accessing variables defined in RULE_INIT. They do have to use the syntax $::variable instead of $variable though.

     

     

    Likewise, the classes are referenced as $::classname even if they are defined as just classname.

     

     

    -Al

     

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Likewise I've had no problems accessing variables in 9.2.3 as of yet. Perhaps there's a more specific problem occuring?

     

     

    Colin
  • Raymond_Feng_97's avatar
    Raymond_Feng_97
    Historic F5 Account
    well!!!

     

    we must use $::variable instead of $variable for v9.2.3, then the problem won't come.

     

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    That's what I was trying to say with my earlier post, by saying that they are treated as global variables. I'm sorry I didn't state things more clearly. :-/

     

     

    Colin