Run Capacity Scan and Upload Results Exit Code=255

I’m receiving this exit code when running “Run Capacity Scan and Upload Results” action. The action looks like it is failing at the below sections. Does anyone have any insight to what might be causing this? I have already tried restarting the WMI service which i seen fixed someone issue similar to ours which did not work. Any help is appreciated.

Client Log:

Command succeeded parameter “sourceReleaseDate” = “2017-10-04” (action:50126)
Command succeeded parameter “forceResultsUpload” = “false” (action:50126)
Command succeeded parameter “homefolder” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT” (action:50126)
Command succeeded parameter “citconfigfile” = “C:\Windows\cit” (action:50126)
Command succeeded parameter “citinstalldir” = “C:\Program Files (x86)\Tivoli\cit” (action:50126)
Command succeeded parameter “outdir” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_scans” (action:50126)
Command succeeded parameter “compressedfile” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\11667147_tlm_hw.zip” (action:50126)
Command succeeded parameter “slash” = “” (action:50126)
Command succeeded runhidden cmd /c mkdir “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_scans” (action:50126)
Command succeeded runhidden cmd /c mkdir “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT” (action:50126)
Command succeeded parameter “scanResultsLimit” = “7” (action:50126)
Command succeeded parameter “cpacityConfigXml” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_config.xml” (action:50126)
Command succeeded parameter “logfilepath” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\11667147_cit_tlm_hw.log” (action:50126)
Command succeeded delete “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_config.xml” (action:50126)
Command succeeded createfile until (action:50126)
Command succeeded move __createfile “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_config.xml” (action:50126)
Command succeeded parameter “epoch” = “1537297085” (action:50126)
Command succeeded parameter “timestamp” = “201809181458” (action:50126)
Command succeeded parameter “scanfilepath” = “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\tlm_hw_scans\tlm_hw_201809181458_1537297085.xml” (action:50126)
Command succeeded parameter “lastscanfile” = “” (action:50126)
Command succeeded createfile until (action:50126)
Command succeeded delete “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\runcit_tlm_hw.bat” (action:50126)
Command succeeded move __createfile “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\runcit_tlm_hw.bat” (action:50126)
Command started - waithidden cmd.exe /c ““C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\runcit_tlm_hw.bat” > “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\11667147_cit_tlm_hw.log” 2>&1” (action:50126)
Command succeeded (Exit Code=255) waithidden cmd.exe /c ““C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\runcit_tlm_hw.bat” > “C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\11667147_cit_tlm_hw.log” 2>&1” (action:50126)
Command succeeded (evaluated false) continue if {exit code of action = 0} (action:50126)
At 14:58:05 -0400 -
ActionLogMessage: (action:50126) ending actionEx
At 14:58:06 -0400 -

Action Info:

Completed //*********************************** CREATE FILE “runcit_tlm_hw.bat” END *********************************** //
Completed delete "{parameter “homefolder” as string}\runcit_tlm_hw.bat"
Completed move __createfile “{parameter “homefolder” as string}\runcit_tlm_hw.bat"
Completed waithidden cmd.exe /c “”{parameter “homefolder” as string}\runcit_tlm_hw.bat” > “{parameter “logfilepath” as string}” 2>&1"
Failed continue if {exit code of action = 0}
continue if {(exists file ((parameter “scanfilepath”) as string))}
// Validate the generated capacity scan output and exit with error code when one of the key nodes in not present in XML file
//*********************************** CREATE FILE “checkCapacityScanOutput.vbs” START *********************************** //
createfile until eofdelim
Function checkFile(fileName)
Set xmlDoc = CreateObject(“Msxml2.DOMDocument”)
xmlDoc.load(fileName)
Set objNodeList = xmlDoc.getElementsByTagName(“ComponentID”)
If objNodeList.length <> 1 then
checkFile=1
Exit Function
End If
Set objNodeList = objNodeList.item(0).getElementsByTagName(“SerialNumber”)
If objNodeList.length <> 1 then
checkFile=2
Exit Function
Else
If objNodeList.item(0).Text = “” then
checkFile=3
Exit Function
End If
End If
Set objNodeList = xmlDoc.getElementsByTagName(“PhysicalProcessor”)
If objNodeList.length = 0 then
checkFile=4
Exit Function

Thanks.

Can you try executing the script manually on the server? The logs would contain information as to why it failed.

@dwilson The actionscript continue if {exit code of action = 0} is used to capture and validate the previous line’s batch file execution.

This line had a non-zero return code: waithidden cmd.exe /c ""{parameter "homefolder" as string}\runcit_tlm_hw.bat”"> "{parameter "logfilepath" as string}" 2>&1"

The OS was able to run the command, but not to success. Check the log file ‘“C:\Program Files (x86)\BigFix Enterprise\BES Client\LMT\CIT\11667147_cit_tlm_hw.log”’ for details of the failure.

Below is what the 13899791_cit_tlm_hw.log gave me.

‘wmic’ is not recognized as an internal or external command,
operable program or batch file.
10 was unexpected at this time.

After doing some more research on the error that was in the log. I found that the WBEM directory needed to be added to the PATH directory inside the Environment Variables in order for the script to know where to execute WMIC.exe from. Once I added this line and reran the action everything is working and completing with exit code 0. Thanks again for your help.

I have ran into this issue where another console operator broke the Path Environment Variable with a task, it would work for the user but not the system account. I created a task to fix it but the machine needs to be restarted after it runs.

prefetch psexec.exe

// Backup current environment variables just encase something goes wrong
waithidden cmd.exe /c set >> "C:\windows\Temp\wmi.txt"

delete c:\windows\temp\wmi.bat
delete __createfile

createfile until EOF
"{pathname of file "setx.exe" of system x64 folder}" /m PATH "{substring after "Path=" of lines whose (it starts with "Path=") of file "wmi.txt" of folder "C:\Windows\Temp"};C:\MinGW\MSYS\1.0\bin"
EOF

delete wmi.bat
move __createfile C:\Windows\Temp\wmi.bat

wait __Download\psexec.exe -accepteula -s -i 0 C:\Windows\Temp\wmi.bat

Hello,

Could you please let me know how you re-written the line in the code. I am also getting the same error.

Thanks
Mayank

Mayank,

In my instance I found in the log where the script was trying to call WMIC to execute. Since the directory to the executable wasn’t in the Environment Variable path it did not know how to get to it and would sit at that line time out and return Exit code 255. In order to resolve my issue I added that path to EV so that it could find WMIC and that fixed our problem. One thing to add code 255 is somewhat of a generic exit code and can be generated by numerous reasons. You would need to search the logs to find out what it is missing and then correct from there.