F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

amit_128525's avatar
amit_128525
Icon for Nimbostratus rankNimbostratus
Jan 02, 2014

TCL error

Hello , We are getting below error in logs on our F5 loadbalancer , was trying to understand what it is related to . If anyone can help .

 

TCL error: iR_XFF_RewriteOrInsert - Operation not supported (line 4) invoked from within "HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"]

 

10 Replies

  • Can you include some or all of the code for iR_XFF_RewriteOrInsert? Of particular interest is line 4....

     

  • thanks for reply was just trying to find where I need to see line4 as I am using GUI , do I need to check it on command line

     

    • Kevin_Stewart's avatar
      Kevin_Stewart
      Icon for Employee rankEmployee
      I believe Joey and Josh are asking you to post the complete iRule, which would be most helpful for troubleshooting.
  • hello below is the irule .

     

    when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] } }

     

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    amit, might this be a simple formatting issue?

    This appears ok on my test system:

    when HTTP_REQUEST { 
      if {[HTTP::header exists X-Forwarded-For]}{ 
        HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] 
      } else { 
         HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] 
      } 
     }
    

    See if that helps,

    N

  • thanks for reply Nathan , but irule seems to be fine with format which i have used not sure why we are still getting this alert

     

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Amit,

    According to the wiki on HTTP::header:

    This command performs a header insertion if the header was not present.
    

    So do we need the HTTP::insert line after all?

    Could it just be:

    when HTTP_REQUEST { 
    HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"]
    }
    

    But to answer your question it's not the else statement but the insert command it looks like it doesn't like. What happens it you change the line to be:

    HTTP::header insert X-Forwarded-For [IP::client_addr]
    

    Does this work and then point to the substr being the issue?

    Just a thought.

    N

  • Thanks for detailed reply , one thing we never had these logs earlier , we have started getting these logs when we placed another irule with the existing irule under the VS existing irule when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] } }

     

    new irule added last week to function with existing irule when HTTP_REQUEST { if {([class match [IP::remote_addr] equals whitelist]) } { pool Pool_1 } else { HTTP::respond 503 content [b64decode [class element -name 0 DG_MAINTENANCE_HTML]] "Content-Type" "text/html" } }