Forum Discussion

Techchic_108423's avatar
Techchic_108423
Icon for Nimbostratus rankNimbostratus
Dec 02, 2008

TCL error in logging

Hi,

 

 

We have an irule that seems to be bringing up and error but I'm not really sure what it is. Wondering if anyone had any ideas. The error being repeatedly generated is;

 

 

 

:header replace Cache-Control no-cache "

 

Dec 2 08:10:36 tmm tmm[928]: 01220001:3: TCL error: Rule AllowCacheSyst - Operation not supported (line 16) invoked from within "HTTP::header replace Cache-Control no-cache "

 

Dec 2 08:10:36 tmm tmm[928]: 01220001:3: TCL error: Rule AllowCacheSyst - Operation not supported (line 16) invoked from within "HTTP::header replace Cache-Control no-cache "

 

Dec 2 08:10:37 tmm tmm[928]: 01220001:3: TCL error: Rule AllowCacheSyst - Operation not supported (line 16) invoked from within "HTTP::header replace Cache-Control no-cache "

 

 

 

The rule that is currenlty being used is;

 

 

 

 

when HTTP_RESPONSE {

 

set headerCT [HTTP::header Content-Type]

 

set CacheC [HTTP::header Cache-Control]

 

if {$headerCT eq "image/gif" or $headerCT eq "image/jpeg"} {

 

if {$CacheC eq "private"} { this is a chart

 

do nothing

 

} else {

 

HTTP::header replace Cache-Control private,max-age=14400,must-revalidate

 

}

 

} elseif {$headerCT eq "text/css" or $headerCT eq "application/x-javascript" or $headerCT eq "application/x-shockwave-flash" } {

 

HTTP::header replace Cache-Control private,max-age=14400,must-revalidate

 

} elseif {$headerCT eq "text/xml"} {

 

HTTP::header replace Cache-Control no-cache

 

} elseif {$headerCT eq "image/png"} {

 

HTTP::header replace Cache-Control no-cache

 

} elseif {$headerCT contains "text/html"} {

 

HTTP::header replace Cache-Control no-cache

 

HTTP::header replace Pragma no-cache

 

HTTP::header insert { "X-Cache-Hit" "Yes" }

 

}

 

 

if { [HTTP::status] contains "302"} {

 

HTTP::header replace Cache-Control no-cache

 

HTTP::header replace Pragma no-cache

 

}

 

 

foreach cookie [HTTP::cookie names]

 

{

 

set value [HTTP::cookie value $cookie];

 

if { "" != $value }

 

{

 

set testvalue [string tolower $value]

 

set valuelen [string length $value]

 

log local0. "Cookie found: $cookie = $value";

 

switch -glob $testvalue {

 

"*;secure*" -

 

"*; secure*" { }

 

default { set value "$value; Secure"; }

 

}

 

switch -glob $testvalue {

 

"*;httponly*" -

 

"*; httponly*" { }

 

default { set value "$value; HttpOnly"; }

 

}

 

if { [string length $value] > $valuelen} {

 

log local0. "Replacing cookie $cookie with $value"

 

HTTP::cookie value $cookie "${value}"

 

}

 

}

 

}

 

 

}

 

 

 

I'm just a bit confused as I would have thought the error would repeat on the other lines where the same line of code is but it seems to just be line 16

 

 

} elseif {$headerCT contains "text/html"} {

 

HTTP::header replace Cache-Control no-cache

 

 

Anby help would be much appreciated!

 

 

Thanks!

 

 

Claire
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Claire,

     

     

    I think the main cause of that error is that a redirect has already been triggered for that request/response. Do you have another iRule on the same VIP which could be redirecting before this one runs?

     

     

    Else, can you save the request details in HTTP_REQUEST and log them in each response before doing the header updates? This might give you more information on when the TCL error is happening.

     

     

    Aaron