Forum Discussion

CraigM_17826's avatar
CraigM_17826
Icon for Altostratus rankAltostratus
Mar 02, 2010

TCL error

Hi,

 

 

I am seeing the following error in the LTM log

 

 

Mar 2 16:55:15 local/tmm err tmm[2483]: 01220001:3: TCL error: WPS_Dev_HTTPS - Operation not supported. Multiple redirect/respond invocations not allowed (line 80) invoked from within "HTTP::redirect "https://[HTTP::host]/wps/portal/studying/detail?WCM_GLOBAL_CONTEXT=/migration/error/error-has-occurred""

 

 

and this is the code that is causing the above error. All I am trying to do is to test to see if up or down and use a pool if it's up or do a redirect if the pool is down. Due to other issues to mimic the pool being down I've changed the test to see if there are more than 10 nodes in the pool active which their wont be.

 

 

     
     when HTTP_Request {     
     if { [string tolower [HTTP::uri]] starts_with "/services" } {     
     if { [active_members "Pool_A"] > 10 } {       
              pool "Pool_A"       
         } else {     
            HTTP::redirect "https://[HTTP::host]/wps/portal/studying/detail?WCM_GLOBAL_CONTEXT=/migration/error/error-has-occurred"     
         }       
      }     
     

 

 

I have managed to get round this by splitting this the above up into two seperate blocks

 

 

     
     when HTTP_REQUEST {     
     set use_pool_A "no"     
     if { [string tolower [HTTP::uri]] starts_with "/services" } {     
        if { [active_members "Pool_A"] > 10 } {       
           set use_pool_A "yes"     
        } else {     
          set use_pool_A "no"      
        }       
      }     
          
     if { $use_pool_A == "yes"} {     
       pool "Pool_A"     
        } else {     
     HTTP::redirect "https://HTTP::[host]/wps/portal/studying/detail?WCM_GLOBAL_CONTEXT=/migration/error/error-has-occurred"     
     }      
          
     

 

 

I'm just wondering what was wrong with the first version.

 

 

Regards

 

 

Craig

2 Replies

  • Hi Craig,

     

    It looks more about syntax then logic.

     

     

    Here is the code again with some syntax corrected.

     

     

     

     
      
     when HTTP_REQUEST { 
     if {[string tolower [HTTP::uri]] starts_with "/services" } { 
     if {[active_members "pool_A"] > 10 } { 
     pool Pool_A 
     } else { 
     HTTP::redirect "https://[HTTP::host]/wps/portal/studying/detail?WCM_GLOBAL_CONTEXT=/migration/error/error-has-occurred"  
     } 
     } 
     } 
     

     

     

    I hope this helps

     

     

    Bhattman
  • I don't think a syntax error would trigger the "Multiple redirect/respond invocations not allowed" runtime error. I'd guess Craig didn't copy the iRule he saw the error with verbatim as that one couldn't be saved.

     

     

    Craig, do you have another iRule that's redirecting the client or sending an HTTP response with HTTP::respond? Or did you have other code in the same iRule that was potentially sending a redirect for multiple cases?

     

     

    Aaron