What is Exit Code 12?

Hi,

I’m working on a fixlet that will copy a customized default user profile on an install of macOS 10.12 “Sierra” before upgrading it to 10.13 “High Sierra.” The unix commands from the fixlet work if they’re executed interactively or through ARD. BigFix/IEM runs those same commands successfully and exits successfully, but not with code 0. Code 12 is the result and the fixlet actually doesn’t create the ZIP file from the copied profile, despite all of the fixlet’s steps completing successfully. Here’s the output from the error log.

At 19:18:38 -0400 -
ActionLogMessage: (action:737088) Action signature verified for Execution
ActionLogMessage: (action:737088) starting action
At 19:18:38 -0400 - actionsite (http://iemsrv.domain.com:12345/cgi-bin/bfgather.exe/actionsite)
Command started - wait zip -r -X /Stuff/English.zip /System/Library/User\ Template/English.lproj (action:737088)
At 19:18:38 -0400 -
Report posted successfully
At 19:18:38 -0400 - actionsite (http://iemsrv.domain.com:12345/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Exit Code=12) wait zip -r -X /Stuff/English.zip /System/Library/User\ Template/English.lproj (action:737088)
At 19:18:38 -0400 -
ActionLogMessage: (action:737088) ending action
At 19:18:39 -0400 - mailboxsite (http://iemsrv.domain.com:12345/cgi-bin/bfgather.exe/mailboxsite2351101)
Not Relevant - Backup macOS Default User Profile - TestMac (fixlet:737088)
At 19:18:39 -0400 -
Report posted successfully
Report posted successfully
IBM BigFix Restart (Force count:1) from ActionID 737088
At 19:18:56 -0400 - BES Support (http://sync.bigfix.com/cgi-bin/bfgather/bessupport)
Relevant - Restart Needed (fixlet:177)
At 19:19:02 -0400 - Server Automation (http://sync.bigfix.com/cgi-bin/bfgather/serverautomation)
Relevant - Restart Endpoint on Pending Restart and Wait for Restart to Complete (fixlet:160)
At 19:19:42 -0400 -
Client shutdown (Service manager stop request)

I cannot find what exit code 12 means in any context. The best I can find relates to the installation of a scanner with BigFix/IEM, but nothing about such an exit code.

Here’s the fixlet:

// Check for Stuff folder, if it is not there, create it.
if {not exist folder “/Stuff”}
folder create "/Stuff"
endif
// Create an archive from the current English.lproj
wait zip -r -X /Stuff/English.zip /System/Library/User\ Template/English.lproj

BigFix just returns the exit code given from the command, so in this case exit code 12 is coming from the ‘zip’ command.
(I have no idea what it means, but hopefully that helps narrow it down)

1 Like

Exit code 12 is “zip has nothing to do” according to the link above.

Weird… I guess BigFix isn’t the right tool to do this. Thanks everyone!

BigFix can do anything you can do on the command line just be aware that its doing it as root on the Mac

1 Like

BigFix should definitely be able to do this. It seems like the parameters aren’t being passed to zip correctly or maybe it needs the folder to already exist in order for this to work.

Can you get this to work on the command line without bigfix as is? If so, then there are some steps to troubleshoot it.

Works fine through a shell or ARD.

1 Like

I got this to work by running

wait zip -r -X "/Stuff/English.zip" "/System/Library/User Template/English.lproj"

I generally find that BigFix isn’t super happy with paths that escape spaces in file paths, so I tend to encase paths (with spaces) in quotes.

1 Like

Try:

wait bash -c "zip -r -X /Stuff/English.zip /System/Library/User\ Template/English.lproj"

sometimes it helps to call something through bash.

Or forget what I said and do that, though it is possible both might work.