Forum Discussion

Yozzer's avatar
Yozzer
Icon for Nimbostratus rankNimbostratus
Nov 19, 2018

Tcl error thrown from multi vip used irule

How can i tell if an irule is used on multiple vips throws a tcl error which vip it errored from?

 

Thanks

 

8 Replies

  • Yozzer's avatar
    Yozzer
    Icon for Nimbostratus rankNimbostratus

    Its “Operation not supported (line 1) invoked from within "HTTP::header insert” which we know how to resolve. But we just want to isolate the vips its having issues on.

     

  • Hello,

    The way i do it is, since you know where the error is coming from, you can put and try and catch to take the error out. And then you can print the name of the VS inside the catch which will automatically give the name of the vs that has the problem

    log local0. "Current virtual server name: [virtual name]"
    I hope it helps you narrow your problem

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    try this as well

    local0. "client ip address is [IP::client_addr];URL request is [HTTP::host] [HTTP::uri];HTTP method is [HTTP::method];HTTP Accetp-coding header is [HTTP::header Accept-Encoding]"
    
  • Yozzer's avatar
    Yozzer
    Icon for Nimbostratus rankNimbostratus

    Thanks, Is there a way to add text to the TCL error when it needs to be called? If i add a log entry to the irule i would get hundreds or logs that the irule was run but no link between the tcl error and vip. The error is caused by too many redirect commands in other irules:

    TCL error: /Common/CXframe-injection  - Operation not supported (line 3) invoked from within "HTTP::header insert "X-FRAME-OPTIONS" "SAMEORIGIN""
    

    So i want to identify which irule on a vip is erroring as the same irule is used on multiple vips.

  • Hi,

     

    In the HTTP_REQUEST event, put your code inside this :

     

    when HTTP_REQUEST {    
        if {[ catch {        
            Your code here            
        }]} {         
           Log local0. "This code raised an error on virtual server [virtual name]"           
        }    
    }