Forum Discussion

vivek_76299's avatar
vivek_76299
Icon for Nimbostratus rankNimbostratus
Jan 20, 2012

Help needed regarding HTTP downgrade using iRule - Getting TCL Error

Hi All,

 

We are using an iRule to downgrade some specific responses from HTTP1.1 to HTTP1.0. Below is the iRule.

 

 

iRule:

 

----------------------

 

when HTTP_RESPONSE{

 

 

if { ([HTTP::header "content-Type"] starts_with "text/csv") || ([HTTP::header "content-Type"] starts_with "application/ms-excel")} {

 

if {[HTTP::version] == "1.1" } {

 

 

HTTP::version "1.0"

 

}

 

}

 

}

 

------------------------

 

 

We see below TCL errors in ltm logs. Can someone please help on these errors.

 

 

Errors:

 

Jan 19 15:12:43 local/tmm2 err tmm2[6237]: 01220001:3: TCL error: ir_downgrade_HTTP10 - Illegal argument. Can't execute in the current context. (line 1) invoked from within "HTTP::header "Content-Type""

 

 

Please suggest.

 

 

Thanks in advance.

 

7 Replies

  • Hi Vivek,

     

     

    Which LTM version are you running? Do you have any modules enabled for the virtual server you have the iRule enabled on?

     

     

    Aaron
  • Hi Aaron,

     

    We are using LTM of version 10.2.

     

    Below are the modules used in the virtual server.

     

     

    Oneconnect Profile

     

    HTTP Profile

     

    SSL Profile (client)

     

    Cookie persistence.

     

  • Do you have any other iRules enabled on the virtual server? Is that the full iRule you posted above?

     

     

    Aaron
  • Hi Aaron,

     

    There are no other iRules enabled for the virtual server and the iRule pasted in the above post is the complete iRule.
  • The only references to this error I could find involved multiple iRules where one redirected the request and another tried to get the content-type header value. Do you have rewrite redirects enabled on the HTTP profile?

     

     

    Else, if you'd like to work on this more quickly, you could open a case with F5 Support. They'll be able to look at your full configuration and help determine why the error is being generated.

     

     

    Aaron
  • I just upgraded from version 10.2.0 to version 11.2.0 and started seeing errors some as described above e.g. "HTTP::version"

     

     

    I also some some similar errors about "HTTP::status" as described in https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2160923/showtab/groupforums/Default.aspx which references BZ374390 and has the comment that one could ask for a HOTFIX

     

     

    From my /var/log/ltm

     

     

    Aug 14 07:59:34 tmm err tmm[9349]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 1) invoked from within "HTTP::version "1.0""

     

    Aug 14 08:00:11 tmm1 err tmm1[9350]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 1) invoked from within "HTTP::version "1.0""

     

    Aug 14 08:30:13 tmm err tmm[9349]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 300) invoked from within "HTTP::version "1.0""

     

    Aug 14 08:56:18 tmm1 err tmm1[9350]: 01220001:3: TCL error: /Common/hele_main_http - Illegal argument. Invalid client side API (line 300) invoked from within "HTTP::status"

     

    Aug 14 08:56:54 tmm1 err tmm1[9350]: 01220001:3: TCL error: /Common/hele_main_http - Illegal argument. Invalid client side API (line 15) invoked from within "HTTP::status"

     

    Aug 14 10:11:24 tmm1 err tmm1[9350]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 15) invoked from within "HTTP::version "1.0""

     

    Aug 14 10:12:20 tmm err tmm[9349]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 300) invoked from within "HTTP::version "1.0""

     

    Aug 14 10:12:31 tmm err tmm[9349]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 300) invoked from within "HTTP::version "1.0""

     

    Aug 14 10:13:16 tmm1 err tmm1[9350]: 01220001:3: TCL error: /Common/hele_main_http - Not found (line 300) invoked from within "HTTP::version "1.0""

     

     

    Looking at the above across more than three hours of operation I have four (4) unique formats all in the same iRULE, e.g. hele_main_http

     

     

    TCL error: /Common/hele_main_http - Not found (line 1) invoked from within "HTTP::version "1.0""

     

    TCL error: /Common/hele_main_http - Not found (line 15) invoked from within "HTTP::version "1.0""

     

    TCL error: /Common/hele_main_http - Not found (line 300) invoked from within "HTTP::version "1.0""

     

    TCL error: /Common/hele_main_http - Illegal argument. Invalid client side API (line 15) invoked from within "HTTP::status"

     

    TCL error: /Common/hele_main_http - Illegal argument. Invalid client side API (line 300) invoked from within "HTTP::status"

     

     

    This iRULE has just four (4) occurrences of HTTP::version

     

     

    [jstrabala@www:Active:Standalone] ~ grep HTTP::version /tmp/bigip.conf.copy.hele_main_http_only | sed -e 's/^\s*/ /'

     

    append info " host [HTTP::host] method [HTTP::method] ver [HTTP::version] uri [HTTP::uri]"

     

    append info " [HTTP::version]"

     

    if { [HTTP::version] eq "1.1" } {

     

    HTTP::version "1.0"

     

    [jstrabala@www:Active:Standalone] ~

     

     

    This iRULE has just three (3) occurrences of HTTP::status

     

     

    [jstrabala@www:Active:Standalone] ~ grep HTTP::status /tmp/bigip.conf.copy.hele_main_http_only | sed -e 's/^\s*/ /'

     

    if {$icap == 1 && [HTTP::status] != 200} {

     

    if {$enable_debug && $static::h_dbg_icap_skip>3} { log local0. "skip icap, <[HTTP::status]>!=200, host <$lchost> path <$lcpath>" }

     

    if {$enable_debug && $static::h_dbg_icap_skip>2} { log local0. "skip icap, stat <[HTTP::status]>!=200 || type <[HTTP::header Content-Type]>!=text/html || enc <[HTTP::header Content-Encoding]>!=<>, path <$lcpath>"}

     

    [jstrabala@www:Active:Standalone] ~

     

     

    Since I never saw any such "errors" in version 10.2.0 is this a bug in version 11.2.0 of the FT Big-IP LTM software. I have also asked for clarification in case number C1171849

     

     

    Thanks in Advance

     

     

    Jon Strabala
  • Hi Jon,

     

     

    BZ374390 was fixed in 11.2.0 so either it's a regression or a different issue. If you have a case opened with F5 Support I suggest continuing working with them. They'll be able to review your full config and ideally tcpdumps of a failure. I tried to review the case notes but with the access I have couldn't see the part of your case have on the TCL error due to the case length.

     

     

    Aaron