Forum Discussion
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
- Kevin_Stewart
Employee
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:
-
Place a catch around the entire section of code.
if { [catch { if { $Blackhole_Match } { ... } } err]} { some error occurred } -
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
Altostratus
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.
- Chura_16140
Nimbostratus
Not sure, I don't to delay requests. I guess I wont to pass this request.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com