jamf / mut

MIT License
131 stars 11 forks source link

MUT v5 saying "update run failed" when trying to add to mobile device static group #37

Closed bfossum closed 4 years ago

bfossum commented 4 years ago

Hello!

Each time I try to use MUT v5 to add iOS devices to a static group, it automatically says "update run failed". Sometimes it works, but still gives the error. Please let me know what other information I can provide.

Screen Shot 2019-08-27 at 5 55 04 PM

tryckman commented 4 years ago

We are experiencing the exact same behavior.

jfiliceatcsumb commented 4 years ago

Similar for Computer groups for me. Tries the first computer, receives 409 error "Error: Unable to match computer" then stops.

mike-levenick commented 4 years ago

I would like to add a bit of clarity here: the 409 error that @jfiliceatcsumb is seeing is a different thing, and is expected behavior.

The 409 -- Unable to match computer, is because MUT v5 attempts to update the entire group at once. If you have a serial number in your CSV which does not exist in Jamf, it will throw this error. It should tell you which computer is having issues.

You can use "MUT Classic", which is available on the app store, and does things the old inefficient way, adding each individual computer to the group separately. The advantage is, a single line of a non-existent computer won't block the entire update. The disadvantage is it is FAR less efficient, and FAR harder on your server.

As for the others, this seems to be a false negative error, am I correct? The update is actually taking place, but the GUI says it failed?

I'll look into the logic block for the "update failed" messaging and see if I can clear this up.

pirkla commented 4 years ago

I can confirm the same behavior. Adding devices to static device groups using serial number and group id causes it to report "Update run failed. Check the MUT.log for details." The devices are added to the static group(or at least the ones we spot checked)

The log then states "Successful PUT completed. 201. " followed by the xml from the put response.

It is worth noting that I don't believe all the serial numbers in the list were eligible to be added to the group, so maybe it was a partial request. I'm not positive on that point though.

MUT 5_0_5 CSV loads correctly with a list of serial numbers. SSL Cert is trusted. Full admin rights on the user.

pirkla commented 4 years ago

I see the issue. The ViewController.swift checks for status code 200 only for success, but that endpoint replies with a 201 status code indicating it is created. Seems safe to update the code for 201 or 200.

Maybe any 200 code is acceptable, but warn for > 201? Sounds like scope creep, adding 201 seems sufficient.

mike-levenick commented 4 years ago

I’ll get this fixed in 5.1. It should accept any code from 200-299.

jennifertuggle commented 4 years ago

I'm getting this error when the Update run fails. [ERROR ]: Failed scope update. 400. "code" : "DEVICE_DOES_NOT_EXIST_ON_TOKEN" Not sure how to fix it.

mike-levenick commented 4 years ago

This is fixed in https://github.com/mike-levenick/mut/commit/7f1a1aa1a488de09baf909498e54f0b48505a2b6

I'm currently fighting with developer certs, but the updated version should be live on the app store and in Releases in the next few days.