Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

<http_request> - ERR_NOT_SUPPORTED (line 2) invoked from within "HTTP::query"</http_request>

We've running an iRule on v13.1.0.6 which works fine. After upgrading to v14.1.0 the same iRule causes an error:

err tmm[11570]: 01220001:3: TCL error: /Common/test_ir_asm_error-page <HTTP_REQUEST> - ERR_NOT_SUPPORTED (line 2)     invoked from within "HTTP::query"

Here's the responsible part of the iRule:

when HTTP_REQUEST
{
set mainPath "show-error-page"
set mainPathExists "FALSE"

set httpQuery [HTTP::query]
set httpUri [HTTP::uri]
set httpUrlMin [call ir_asm_library::getMinimalizedUrl]

if {$httpUri contains $mainPath}
{
    set mainPathExists "TRUE"
    set iFileErrorPageName [URI::query [HTTP::uri] "page"]
}
}

Why we can't call [HTTP:query] , [HTTP:uri] or [HTTP:host] within a HTTP_REQUEST event anymore?


UPDATE:

We already solved the problem. This issue was caused by another iRule which is attached to the same vServer (executed before) and uses HTTP::respond in order to answer with a css-file used by the asm error page.

The following iRule

when HTTP_REQUEST
{
    switch -glob [string tolower [HTTP::uri]] {
        "/css/if_css_e.css" {HTTP::respond 200 content [ifile get if_asm_css_e] "Content-Type" "text/css" }
        "/css/if_css_e_ext.css" {HTTP::respond 200 content [ifile get if_asm_css_e_ext] "Content-Type" "text/css" }
        "/css/if_css_ee.css" {HTTP::respond 200 content [ifile get if_asm_css_ee] "Content-Type" "text/css" }
    }
}

was replaced by:

when HTTP_REQUEST
{
    switch -glob [string tolower [HTTP::uri]] {
        "/css/if_css_e.css" {HTTP::respond 200 content [ifile get if_asm_css_e] "Content-Type" "text/css"
        "Connection" "Close"
         event disable all }
        "/css/if_css_e_ext.css" {HTTP::respond 200 content [ifile get if_asm_css_e_ext] "Content-Type" "text/css"
        "Connection" "Close"
         event disable all }
        "/css/if_css_ee.css" {HTTP::respond 200 content [ifile get if_asm_css_ee] "Content-Type" "text/css"
        "Connection" "Close"
         event disable all }
    }
}

Is this a bug in v14.1 or a bug in in the iRule which was tolerated by v13.1.0.6 and v14.0.0 ?

1
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

You may not evaluate HTTP request after you execute a HTTP::respond or HTTP::redirect... F5 only enforced this in new versions.

In version 14.0, F5 intruduced a new command to prevent this issue : HTTP::has_responded

try this code to leave the irule if another one made this one invalid.

when HTTP_REQUEST {
  if {[HTTP::has_responded]} {return}
  set mainPath "show-error-page"
  set mainPathExists "FALSE"

  set httpQuery [HTTP::query]
  set httpUri [HTTP::uri]
  set httpUrlMin [call ir_asm_library::getMinimalizedUrl]

  if {$httpUri contains $mainPath}
  {
      set mainPathExists "TRUE"
      set iFileErrorPageName [URI::query [HTTP::uri] "page"]
  }
}
2
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I suspect that they have improved the error handling related to multiple iRules - not a bug per se.

1