Syntax error using "exit code of action"

(imported topic written by SystemAdmin)

I am getting a syntax error in the following code at the “if {exit code…” statement

download http://winbfsrv:52311/Uploads/0e27a70ce23eecfc31770133b156ac79ee9dbf4f/checker.tmp

extract checker.tmp

wait cmd /c junk.exe

if {exit code of action != 0}

exit {exit code of action}

endif

If I comment out the download and extract the code will go through as expected (fails with exit code 1). If I comment out the wait and the if statements, the download and extract work fine.

Here is the output from the client log file for the failure:

==============================================

At 11:45:55 -0500 -

GatherActionMV command received. Version difference, gathering action site.

At 11:45:55 -0500 - actionsite (http://winbfsrv.gulfsoft.local:52311/cgi-bin/bfgather.exe/actionsite)

Download ‘http://127.0.0.1:52311/bfmirror/bfsites/manydirlists_2/__diffsite_ff5ae4a7485c5c734d9e9cd8a8d875bf5ebddf60_to_9170981d59d0f8d3f003ef0f289394ded6a00696’ as ‘__TempUpdateFilename’

At 11:45:55 -0500 -

Gather merging new file C:\Program Files\BigFix Enterprise\BES Client__BESData\actionsite\Action 263.fxf

At 11:45:55 -0500 - actionsite (http://winbfsrv.gulfsoft.local:52311/cgi-bin/bfgather.exe/actionsite)

Successful Synchronization with FixSite (version 701) - ‘http://127.0.0.1:52311/cgi-bin/bfenterprise/BESGatherMirror.exe?url=http://winbfsrv.gulfsoft.local:52311/cgi-bin/bfgather.exe/actionsite

At 11:45:57 -0500 - actionsite (http://winbfsrv.gulfsoft.local:52311/cgi-bin/bfgather.exe/actionsite)

Relevant - Software Distribution - Deploy: Test Edit Code (fixlet:263)

At 11:45:58 -0500 -

ActionLogMessage: (action 263 ) Action signature verified

ActionLogMessage: (action 263 ) Relevance substitution error.

ActionLogMessage: (action 263 ) ending action

At 11:45:58 -0500 - actionsite (http://winbfsrv.gulfsoft.local:52311/cgi-bin/bfgather.exe/actionsite)

Not Relevant - Software Distribution - Deploy: Test Edit Code (fixlet:263)

At 11:46:08 -0500 -

Report posted successfully.

==============================================

I am sure this is something really simple, but I cannot find any docs on the usage other than a couple hits on this forum.

Thanks

Martin

(imported comment written by NoahSalzman)

This should work:

wait cmd /c fake

if {exit code of action != 0}

exit {exit code of action as integer}

endif

Also… SPOON!

(imported comment written by SystemAdmin)

Hi Noah,

That by itself seems to work, but as soon as I add the download at the top, it fails. I also tried the “as integer” in the if statement where the failure is occurring.

And it is “SPOOOOOOOOOOOOOOOOON!” :wink: The Tick is the best!

(imported comment written by NoahSalzman)

This may be a silly question, but are you using 8.0 and higher? The Exit Code stuff is not supported in 7.2.x.

(If you are using 8.0, I’m confused by the Relevance Substitution error in your log… we need to make that go away.)

“Sanity, you’re a madman!”

(imported comment written by SystemAdmin)

I am on 8.0.584. It does work until I put that download in there. From what I can see, it does not even get to the actual execution of the script, it just shows an error right away.

Could someone just take the script from above and try (including the download)

Thanks

(imported comment written by SystemAdmin)

I had the exact same problem you did… and solved it: http://forum.bigfix.com/viewtopic.php?pid=30897