20 July, 2016 Update: None of those possible fixes actually fixed the issue. It’s oddly just a handful of machines. Not sure why those machines in particular are throwing the error.
April 26, 2016 Update: Unfortunately, after doing extensive testing on this, it seems the problem just comes back, and for only certain machines. I’m going to see if these potential fixes work for my misbehaving client machines.
What’s the problem?
For a while, I’ve been running into the issue of some clients erroring out with system_profiler hung; skipping SPApplicationsDataType query: The error doesn’t prevent Munki from running, but no matter how many times I would run Munki checks on those computers (whether scheduled checks or manual checks), the error would persist.
Clearly when MunkiReport is running its scripts (preflight or postflight) Munki is running, it’s allowing only a certain amount of time for the system_profiler command before considering it a timeout.
But there’s something that actually is hanging it. I’m not sure if running the command on its own clears out some kind of cache that needs refreshing, and only one successful (not timed out) system_profiler clears that cache. I don’t know what’s going on there, but that fix worked for me. If you’re seeing a hung system profiler in your MunkiReport, you may want to try running the command on its own. Subsequent Munki checks should be fine afterwards.