Illegal instruction: 4 with jamf enroll command

bearzooka
Contributor

I am preparing a script (based on the famous CasperCheck by @rtrouton) to ensure devices are correctly enrolled and fix them if something is missing.

However, I keep getting an error when the script runs this line:

jamf enroll -invitation $invitationCode -noRecon -noPolicy

The enrollment in fact goes well, and the the device ends up working as expected, but I get the following error:

7170 Illegal instruction: 4  jamf enroll -invitation $invitationCode -noRecon -noPolicy

Strangely, if I run the command on the Terminal, I don't get the error.

I've checked here and there, and it seems that the error is more related to dylibs that the script, of course, is not touching.

Has any of you came across this kind of problem?

4 REPLIES 4

thoule
Valued Contributor II

I'd print out the Invitationcode with an echo command. I might also put it in quotes just to see what it looks like.

bearzooka
Contributor

I tried with quotes on and off, doubles, singles, curly braces… everything but doing an echo there, so I'll try that now.
Thanks.

thoule
Valued Contributor II

Echo will just let you see that something valid is in the enrollment invitation- to make sure there's not bad characters or no content!

Are you using the correct dash for NoRecon and noPolicy? – — - are three different dashes. You might want to try without the noRecon and noPolicy just to see if the error goes away? -t-

bearzooka
Contributor

In fact, I know that the command ends up working correctly (invitation, options and all) because the machines end up enrolled as expected…

So I suppose it's only an error that shows on the stdout, and it comes from one of the tasks that the enroll command triggers, rather than from the command itself.