Relevant substitution error

Hi all,

I am trying to run a fixlet which is relevant. But when I ran it , it says “error” in the console. When I checked log file I found this. It says relevant first and then non relevant. It says relevant substitution error. But the same fixlet ran without any issue on 50% of the servers.
Any idea why is it so?

Relevant - TSCM Evaluator OPENSSH-UNIX (fixlet:51841)
At 14:06:22 +0300 -
ActionLogMessage: (action:51841) Action signature verified for Downloads
ActionLogMessage: (action:51841) Relevance substitution error.
At 14:06:26 +0300 -
ActionLogMessage: (action:51841) ending action
At 14:06:26 +0300 - mailboxsite (http://10.64.75.6:52311/cgi-bin/bfgather.exe/mailboxsite3602733)
Not Relevant - TSCM EvaluatorOPENSSH-UNIX (fixlet:51841)
At 14:10:44 +0300 -
Report posted successfully

Would you be able to post the actionscript here so that we may troubleshoot? Essentially the error means that the actionscript contained some relevance to create a dynamic command based on the endpoint’s local conditions, but that the relevance in the actionscript failed to evaluate properly on the endpoint(s) in question.

Please find the action script


parameter “FUSION_HOME” = "{((pathname of parent folder of parent folder of folder (pathname of client folder of current site))) & “/Fusion”}"
parameter “EVALUATOR_HOME” = "{(parameter “FUSION_HOME”) & “/Evaluator”}"
parameter “EVALUATOR_CONTENT” = "{(parameter “FUSION_HOME”) & “/Evaluator_Content”}"
parameter “POLICY_HOME” = "{(parameter “EVALUATOR_CONTENT”) & “/policies/6e43a02019d44b65cd12b92f5676e6c5”}"
parameter “POLICY_FILE” = "M015-T-Gv3.0-ssh-unix.pol"
parameter “DB_FOLDER” = “dbTmp”

continue if {exists setting “_Server_Codepage” of client}

parameter “SERVER_CODEPAGE” = “{value of setting “_Server_Codepage” of client}”

parameter “JVM_PARAMETERS” = “-Xss128k -Xms16m -Xmx64m”

if{not exist file ((parameter “POLICY_HOME”)&"/"&(parameter “POLICY_FILE”))or (size of it != 505139 or sha1 of it != “2c204f209b027b7a2bd6a6df98e067f9e273f173”) of file ((parameter “POLICY_HOME”) &"/"& (parameter “POLICY_FILE”))}
prefetch M015-T-Gv3.0-ssh-unix.pol sha1:2c204f209b027b7a2bd6a6df98e067f9e273f173 size:505139 URL:/M015-T-Gv3.0-ssh-unix.pol
folder create "{parameter “POLICY_HOME”}“
delete “{((parameter “POLICY_HOME”)&”/”&(parameter “POLICY_FILE”))}"
move __Download/{parameter “POLICY_FILE”} "{(parameter “POLICY_HOME”) & “/”& (parameter “POLICY_FILE”)}"
endif

delete __appendfile

if{(name of operating system as lowercase starts with “win”)}
parameter “POLICY_RUNFILE” = "{(parameter “POLICY_HOME”) & “/run.bat”}"
delete “{parameter “POLICY_RUNFILE”}”

appendfile @ECHO OFF 
appendfile  
appendfile 
appendfile SETLOCAL  
appendfile for %%I in ("{(parameter "EVALUATOR_CONTENT")}") do cd %%~sI 
appendfile "{(parameter "FUSION_HOME")}/Evaluator/java/jre/bin/java.exe" -Djava.compiler=NONE -Dsun.net.inetaddr.ttl=0 -Dnetworkaddress.cache.ttl=0 -Djlog.logCmdPort=1952 {(parameter "JVM_PARAMETERS")} -DENCODING="{(parameter "SERVER_CODEPAGE")}" -DJOBDIR="{parameter "DB_FOLDER"}" -jar "{(parameter "EVALUATOR_HOME")}/jars/evaluator.jar" "{(parameter "POLICY_HOME")&"/"&(parameter "POLICY_FILE")}" > "{(parameter "POLICY_HOME")}"/out.log 
appendfile ENDLOCAL 
appendfile exit 

move __appendfile "{parameter "POLICY_RUNFILE"}" 
wait cmd /C "cd "{(parameter "POLICY_HOME")}" & start /b /belownormal /wait run.bat" 

else
parameter “POLICY_RUNFILE” = "{(parameter “POLICY_HOME”) & “/run.sh”}"
delete “{parameter “POLICY_RUNFILE”}”

appendfile #!/bin/sh 
appendfile  
appendfile     
appendfile if [ -f /etc/SuSE-release ]; then 
appendfile  LC_ALL=$LANG 
appendfile  export LC_ALL 
appendfile fi 
appendfile  
appendfile if [ -r "/bin/nice" ]; then 
appendfile   UNIX_NICE_CMD="/bin/nice -5" 
appendfile else  
appendfile   if [ -r "/usr/bin/nice" ]; then 
appendfile     UNIX_NICE_CMD="/usr/bin/nice -5" 
appendfile   else 
appendfile     UNIX_NICE_CMD="" 
appendfile   fi 
appendfile fi 
appendfile 
appendfile cd {(parameter "EVALUATOR_CONTENT")} 
appendfile $UNIX_NICE_CMD "{(parameter "FUSION_HOME")}/Evaluator/java/jre/bin/java" -Djava.compiler=NONE -Dsun.net.inetaddr.ttl=0 -Dnetworkaddress.cache.ttl=0 -Djlog.logCmdPort=1952  {(parameter "JVM_PARAMETERS")} -DENCODING="{(parameter "SERVER_CODEPAGE")}" -DJOBDIR="{parameter "DB_FOLDER"}" -jar "{(parameter "EVALUATOR_HOME")}/jars/evaluator.jar" "{(parameter "POLICY_HOME")&"/"&(parameter "POLICY_FILE")}" > "{(parameter "POLICY_HOME")}"/out.log 
appendfile  
 
move __appendfile "{parameter "POLICY_RUNFILE"}" 
wait sh "{(parameter "POLICY_RUNFILE")}" 

endif

folder delete "{(parameter “EVALUATOR_CONTENT”)& “/collectors”}"
folder delete “{(parameter “EVALUATOR_CONTENT”)& “/dbTmp”}”

This is a complex topic that’s not very well explained in many places, but I’ve hit it a few times. In your ActionScript, you have a ‘prefetch’ statement. So, before the action begins to execute, the client has to evaluate the ActionScript to figure out the values of the prefetch.

But because the action is not actually Executing yet, no values are set for any of the parameters. So when a statement like

wait sh "{(parameter "POLICY_RUNFILE")}"

tries to evaluate (during the Download phase, not the Execution phase), you’ll get a Relevance Substitution Error on the client - the parameter POLICY_RUNFILE does not exist.

The best way I’ve found out of this is to use a Prefetch Block. Everything within the Prefetch block is executed during the Download evaluation, so you can use substitution there as expected. Note the syntax of “add prefetch item” is slightly different from the “prefetch” statement.

I’m not sure whether you can use Parameters in a prefetch block, but you can try something like:

   begin prefetch block
parameter "FUSION_HOME" = "{((pathname of parent folder of parent folder of folder (pathname of client folder of current site))) & "/Fusion"}" 
parameter "EVALUATOR_HOME" = "{(parameter "FUSION_HOME") & "/Evaluator"}" 
parameter "EVALUATOR_CONTENT" = "{(parameter "FUSION_HOME") & "/Evaluator_Content"}" 
parameter "POLICY_HOME" = "{(parameter "EVALUATOR_CONTENT") & "/policies/6e43a02019d44b65cd12b92f5676e6c5"}" 
parameter "POLICY_FILE" = "M015-T-Gv3.0-ssh-unix.pol" 
parameter "DB_FOLDER" = "dbTmp"

continue if {exists setting "ServerCodepage" of client}

parameter "SERVER_CODEPAGE" = "{value of setting "ServerCodepage" of client}"

parameter "JVM_PARAMETERS" = "-Xss128k -Xms16m -Xmx64m"

if{not exist file ((parameter "POLICY_HOME")&"/"&(parameter "POLICY_FILE"))or (size of it != 505139 or sha1 of it != "2c204f209b027b7a2bd6a6df98e067f9e273f173") of file ((parameter "POLICY_HOME") &"/"& (parameter "POLICY_FILE"))}         

add prefetch item name=M015-T-Gv3.0-ssh-unix.pol sha1=2c204f209b027b7a2bd6a6df98e067f9e273f173 size=505139 url=http://sitename/M015-T-Gv3.0-ssh-unix.pol
endif

//what url did you intend here?

collect prefetch items
end prefetch block

    //do the rest of the action here
1 Like

I didn’t realize this either, but apparently you don’t need collect prefetch items just before end prefetch block because it is implied. Apparently collect prefetch items is so that you can do that multiple times within a prefetch block. So you might have a bunch of prefetch items, grab them, then have more prefetch items that may depend on the previous prefetch items.

Hi,
Thank you for your response.
I have got another error, when I added this. Unable to parse at line 10 ( at the “continue if” line). Command invalid inside prefetch block.

I don’t think you can use a continue if statement within a prefetch block. You can use an if statement to determine what should be downloaded, but then use a continue if statement after the prefetch block.

If something fails to pass the continue if statement, then everything is halted. This is not something that makes sense in a prefetch block because during the prefetch phase, nothing has started that can be halted.

You could have an if statement around everything in the prefetch block to prevent anything from being downloaded if it is all going to be halted anyway, then have the continue if statement just after the prefetch block. This would prevent anything from being downloaded that isn’t going to be used anyway, then halt the action.