We have been running the following relay affiliation code for a long time and it just recently stopped working. I am trying to figure out why. Every time it runs, it errors with: Error: Singular expression refers to nonexistent object.
The format of the subnetmap.txt file is as follows. We only use subnet and city name.
172.29.50.50/24 City name City State Country Region Address Client.
( if (number of elements of it = 0) then ("HeadRelay;*") else concatenation ";" of (elements of it)) of set of /*
Prepare Affiliation String */ ( preceding text of last ";" of ( (if(exists item 0 of it AND item 0 of it != "" ) then
(item 0 of it & ";") else "") /* & (if(exists item 2 of it AND item 2 of it != "" AND item 6 of it is contained by
"state,country,region,all relays" ) then (item 2 of it & ";") else "") & (if(exists item 3 of it AND item 3 of it != ""
AND item 6 of it is contained by "country,region,all relays") then (item 3 of it & ";") else "") & (if(exists item 4
of it AND item 4 of it != "" AND item 6 of it is contained by "region,all relays") then (item 4 of it & ";") else "")
& (if(exists item 6 of it AND item 6 of it = "headend") then ("HeadRelay" & ";") else "") */ )) of /* Disect Line
From SubnetMap.txt */ ( /* Location Code - item 0 */ preceding text of first "%09" of it, /* City Code - item 1 */
preceding text of first "%09" of following text of first "%09" of it, /* State - item 2 */ preceding text of first
"%09" of following text of first "%09" of following text of first "%09" of it, /* Country - item 3 */ preceding text
of first "%09" of following text of first "%09" of following text of first "%09" of following text of first "%09" of it,
/* Region - item 4 */ preceding text of first "%09" of following text of first "%09" of following text of first "%09"
of following text of first "%09"of following text of first "%09" of it, /* Address - item 5 */ preceding text of first
"%09" of following text of first "%09" of following text of first "%09" of following text of first "%09" of following
text of first "%09" of following text of first "%09" of it, /* FailOverFlag item 6 */ following text of first "%09" of
following text of first "%09" of following text of first "%09" of following text of first "%09" of following text of
first "%09" of following text of first "%09" of it ) of /* Remove Duplicates */ (elements of set of it) of /*
Compare Subnets Of Network Adapters To SubnetMap.txt */ ( following texts of firsts "||" of unique values of
( (bit (preceding text of first "%09" of it as integer)) of item 2 of it as string & "||" & following text of first "%09"
of item 2 of it) of ( ( first (following text of first "/" of it as integer) of item 0 of it, first (following text of first "/" of
it as integer) of item 1 of it, item 2 of it ) of ( (item 0 of it & "/" & following text of first "/" of preceding text of
first "%09" of item 1 of it) , ( ( concatenation of (last 8 of ("00000000" & (it as integer) as bits as string)) of
substrings separated by "." of it) of preceding text of first "/" of item 1 of it & "/" & following text of first "/" of
preceding text of first "%09" of item 1 of it ) , (following text of first "/" of item 1 of it) ) of ( ( ( ( concatenations
of (last 8 of ("00000000" & (it as integer) as bits as string)) of substrings separated by "." of it) ) of (( (
addresses whose (it as string != "0.0.0.0") of ip interfaces whose (loopback of it = false) of network ) as
string ) ) ) , ( lines whose ( (it = regex "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/[[:digit:]]+[[:blank:]].*
[[:blank:]].*") AND (it contains "%09") ) of (file "SubnetMap.txt" of client folder of site whose (name of it =
"RelayAffiliation")) ) ) ) whose (item 0 of it = item 1 of it) ) & ";HeadRelay"