Forum Discussion

Chura_16140's avatar
Chura_16140
Icon for Nimbostratus rankNimbostratus
Jul 28, 2014

can't read "Blackhole_Match"

Hi,

 

I'm using https://devcentral.f5.com/articles/v111-dns-blackhole-with-irules to blackhole some domains. However, once every few requests I see this error :

 

Jul 28 18:51:30 err tmm3[10586]: 01220001:3: TCL error: /Common/PROTECT_DNS_BH - can't read "Blackhole_Match": no such variable while executing "if { $Blackhole_Match } { This DNS request was for a Blackhole FQDN. Take different actions based on the request type. switch [DNS::..."

 

I've went over the external file, seems like everything is in place. Also, the blackhole worked, just this error sometimes.

 

Can anyone direct me what to check ?

 

Thanks!

 

3 Replies

  • That's very strange. The variable is created in the DNS_REQUEST event, so the error would indicate that this isn't happening for some random DNS_RESPONSE. There are at least two ways to mitigate this error:

    1. Place a catch around the entire section of code.

      if { [catch {
          if { $Blackhole_Match } {
              ...
          }
      } err]} {
           some error occurred
      }
      
    2. Perform an [info exists ] function before checking for the variable.

      if { ( [info exists Blackhole_Match] ) and ( $Blackhole_Match ) } {
          ...
      }
      

    The question then becomes, what do you want to if an error occurs or the variable doesn't exists?

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    I've seen this error in the past while the class is in the process of being (re)written. My workaround was to perform the check Kevin mentioned (2) and delay the request long enough to give the system time to finish writing the class.

     

    You can also get around it by alternating between two classes.

     

  • Not sure, I don't to delay requests. I guess I wont to pass this request.