Closed adonboli closed 10 months ago
Yeah, I suspect this is due to the very large size of newer macOS updates. If you open System Preferences > Software Update and attempt to run the update in progress, it will show you how far it's gone and estimate download and run times, could always provide that as guidance to folks waiting a long time. But I've definitely seen the update take this long when run manually, and the script unfortunately doesn't provide as much visibility on progress as the native UI.
I'm seeing this, too. I installed the unmodified pkg on a test-machine. The flow of the script works excellent but it hangs on downloading / installing the update. (Intel / Monterey). Let it run for hours. Funny thing is, when I execute the script with sudo I can see the update downloading.
Same behavior when running only the script from Jamf as a policy. If it's started at recurring checkin, the updates hang / don't get downloaded. If I call it manually with sudo jamf policy
I can see the progress like you described.
I am experiencing the same behavior. Tested on multiple intel Monterey machines
IMO it might be helpful to show the output of the softwareupdate command that's being run (eg you can test by running sudo softwareupdate --install --all --restart
)
One example I'm seeing: Software Update Tool
Finding available software Downloading macOS Monterey 12.2 Downloading: 87.95% Failed to download & prepare update: Error Domain=SUOSUErrorDomain Code=201 "Download failed" UserInfo={NSLocalizedRecoverySuggestion=An error occurred while downloading the selected updates. Please check your internet connection and try again., NSLocalizedDescription=Download failed, NSUnderlyingError=0x600001bd04b0 {Error Domain=SUOSUErrorDomain Code=201 "Download failed" UserInfo=
{NSLocalizedDescription=Download failed, NSLocalizedRecoverySuggestion=An error occurred while downloading the selected updates. Please check your internet connection and try again.} }}
Here is what happens when I try to run that command. It asks for a password, I enter it, and it just hangs endlessly after entering the password and hitting enter. This is from an m1.
What is even stranger is tested it on an Intel mac, and it doesn't hang at the password prompt, but says "No Updates Are Available instead. (Even though it is only running 12.2 and should be finding the 12.2.1 update. The gui cant seem to find the update either. Wonder if there is any apple weirdness going on with this latest update.
Intel mac now does find the update but still stuck with the same issue, hanging after password entry.
Wiped both my M1 and Intel Monterey testing machines, installed 12.2 on them (not 12.2.1) and started from scratch with some new testing last night. Results: M1: Working as intended Intel: Still does not work, even leaving the machine on overnight. Same problem as detailed in the above posts remains with it hanging on installing updates (or the password prompts if doing the manual trigger from terminal)
Thanks for helping test this out! Software update instability seems to be a pretty widespread issue with recent macOS Big Sur and macOS Monterey updates, I've seen it discussed all over MacAdmins Slack. I'd recommend reaching out to Apple Enterprise Support to see if relief might come in a future patch.
I already have, snippet below
Subject: Re: [101616806379] SoftwareUpdateD process is inconsistant
Hello,
When you attempted to check for software updates, I see the following error in the log archive:
2022-02-09 14:26:07.091567+0000 0x33C8F Error 0x0 14904 softwareupdated: (SoftwareUpdateMacController) [com.apple.SoftwareUpdateMacController:ScanManager] [ScanFailed] Scan failed with majorError: Error Domain=SUMacControllerError Code=7509 “[SUMacControllerErrorAccessLost=7509] Access control was lost to another client” UserInfo={NSDebugDescription=[SUMacControllerErrorAccessLost=7509] Access control was lost to another client, NSLocalizedDescription=The current software update operation was cancelled due to another process starting a new operation. Please try again later.}
This indicates to me that the softwareupdate binary is being called too frequently.
For testing next steps, I recommend disabling any scripted calls for softwareupdate, disabling “Collect Available software updates” in Jamf’s Inventory Collection, and disabling any other policy in Jamf that might trigger a scripted software update operation. Once completed, run the following kickstart command and perform a single software update scan, using either Terminal or System Preferences:
sudo /bin/launchctl kickstart -k system/com.apple.softwareupdated
Finally, I want to position that Apple recommends using the AvailableOSUpdates command to check for updates via MDM. You may want to speak with Jamf about this command or how they’ve implemented it. Below is a link to our developer documentation on this feature:
https://developer.apple.com/documentation/devicemanagement/list_the_available_os_updates
Yeah, I've turned off software update collection in Jamf Pro inventory in our environment to lighten the load on that process. Any reduction in checks in this script, or moving to MDM-based checks, would require pretty substantial adjustments, but this might be necessary in future macOS releases if these trends continue.
Hi, sorry new at using your tool but I am still having the same issue with my test Intel system as it hangs as well. Not sure if caught everything posted earlier but seems like there isn't quite a solution yet for Intel Macs?
Here's the log stream off my latest attempt:
~ % log stream --style syslog --predicate 'senderImagePath ENDSWITH "logger"'
Filtering the log data using "senderImagePath ENDSWITH "logger""
Timestamp (process)[PID]
2022-02-22 23:07:29.338244-0800 localhost logger[3396]: Starting Install or Defer.sh. Performing validation and error checking...
2022-02-22 23:07:29.450387-0800 localhost logger[3396]: Connection to swscan.apple.com port 443 [tcp/https] succeeded!
2022-02-22 23:07:29.563756-0800 localhost logger[3396]: Validation and error checking passed. Starting main process...
2022-02-22 23:07:29.564310-0800 localhost logger[3396]: Install button label undefined by administrator. Using default value.
2022-02-22 23:07:29.564525-0800 localhost logger[3396]: Install button label: Install
2022-02-22 23:07:29.564785-0800 localhost logger[3396]: Defer button label undefined by administrator. Using default value.
2022-02-22 23:07:29.565199-0800 localhost logger[3396]: Defer button label: Defer
2022-02-22 23:07:29.565265-0800 localhost logger[3396]: Maximum deferral time preference undefined by administrator, or not set to a positive integer. Using default value.
2022-02-22 23:07:29.569386-0800 localhost logger[3396]: Maximum deferral time: 03d:00h:00m:00s
2022-02-22 23:07:29.569536-0800 localhost logger[3396]: Messaging logo undefined by admininstrator, or not found at specified path. Using default value.
2022-02-22 23:07:29.569617-0800 localhost logger[3396]: Messaging logo: /System/Library/PreferencePanes/SoftwareUpdate.prefPane/Contents/Resources/SoftwareUpdate.icns
2022-02-22 23:07:29.569669-0800 localhost logger[3396]: Support contact: IT
2022-02-22 23:07:29.592716-0800 localhost logger[3396]: Kickstarting com.apple.softwareupdated...
2022-02-22 23:08:34.683099-0800 localhost logger[3396]: Checking for pending system updates...
2022-02-22 23:08:47.795687-0800 localhost logger[3396]: Deferral deadline: 2022-02-25 23:08:47
2022-02-22 23:08:47.797527-0800 localhost logger[3396]: Time remaining: 03d:00h:00m:00s
2022-02-22 23:08:47.826882-0800 localhost logger[3396]: Prompting to install updates now or defer...
2022-02-22 23:09:33.742204-0800 localhost logger[3396]: User clicked Install after 00d:00h:00m:46s.
2022-02-22 23:09:33.772455-0800 localhost logger[3396]: Kickstarting com.apple.softwareupdated...
2022-02-22 23:09:33.904571-0800 localhost logger[3396]: 2022-02-22 23:09:33.904 jamfHelper[3642:16254] XType: com.apple.fonts is not accessible.
2022-02-22 23:09:33.904651-0800 localhost logger[3396]: 2022-02-22 23:09:33.904 jamfHelper[3642:16254] XType: XTFontStaticRegistry is enabled.
2022-02-22 23:10:38.851072-0800 localhost logger[3396]: Installing all Apple system updates...
2022-02-22 23:10:38.851312-0800 localhost logger[3396]: System will restart as soon as the update is finished. Cleanup tasks will run on a subsequent update check.
I even ran the kickstart command manually without traction or output.
This was ran on a MacBook Air Intel running Monterey 12.1 (was trying to get to 12.2.1).
Can you please guide me in the right direction?
Thank you!
Can someone please advise if possible?
Hey, we unfortunately don't have surefire fixes for this issue at the moment, since software update reliability seems to have tanked considerably with recent macOS Big Sur and Monterey updates on MDM-managed Macs (which is everyone using this script framework). If you haven't already, please reach out to Apple Enterprise Support so they are aware how much of an impact these issues have, and hopefully that will help bring faster solutions. In the meantime, I'd recommend updating to the latest version of Install or Defer (5.0.1 at the moment; 5.0.2 will probably drop in the next few days with a minor bug fix for folks running beta macOS releases) and seeing if the fixes I've applied there make your update runs more reliable.
Has anyone tried this on intel machines with the 12.3 beta yet that is out now? We really need a solution for our org soon as we have a huge number of machines.
The last few 12.3 beta releases have indicated that they specifically address some software update stability issues so fingers crossed that this release helps. Note that you'd probably need to update to 12.3 (hopefully 11.6.5 includes this fix too) to get the fix, meaning 12.2.1-to-12.3 may still encounter issues unless Apple has a way to improve update reliability before receiving the patch.
Looks like the official 12.3 dropped today.
Yep, and 11.6.5 which will hopefully bring relief for #54. 🤞🏻
Has anyone compared Install or Defer to Nudge? What are the major differences? I would prefer to use our tried and tested Install or Defer workflow which has worked great for us in the past, but I am not sure how long our organization is willing to wait without proper enforcement.
From a quick read I don't think it has any issues with Monterey and Intel machines, but from what I gather it looks like Nudge makes the user initiate the update manually via Software Update on BOTH intel and m1, and just continues to hassle the user until they do it. As opposed to Install or Defer which seems to perform things in a more truly forced / automated fashion by utilizing softwareupdated for Intel users then requiring the manual clicks by having the user navigate to Software Update through the gui for M1 only (due to apple security limitations)
The more automated / forced method via softwareupdated for intel machines seems preferable.
For what it's worth, I intend on modifying my fork of install-or-defer this week so that the update button also pushes users to System Preferences > Software Update. At least then, if the update fails, the user is notified in a more transparent way (and they aren't stuck with a floating "Updates are being installed" window"). Perhaps at the end of the deferral window, if the user still hasn't updated, I'll enforce the update using the softwareupdate command.
On Mon, Mar 14, 2022 at 4:20 PM romnation1 @.***> wrote:
Has anyone compared Install or Defer to Nudge? What are the major differences? I would prefer to use our tried and tested Install or Defer workflow which has worked great for us in the past, but I am not sure how long our organization is willing to wait without proper enforcement.
From a quick read I don't think it has any issues with Monterey and Intel machines, but from what I gather it looks like Nudge makes the user initiate the update manually via Software Update on BOTH intel and m1, and just continues to hassle the user until they do it. As opposed to Install or Defer which seems to perform things in a more truly forced / automated fashion by utilizing softwareupdated for Intel users then requiring the manual clicks for M1 only (due to apple security limitations)
— Reply to this email directly, view it on GitHub https://github.com/mpanighetti/install-or-defer/issues/76#issuecomment-1067395388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRVCXIZHX2ACTL454QUWSLU77CSNANCNFSM5OFO6FZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Has anyone compared Install or Defer to Nudge? What are the major differences?
From what I understand, Nudge is a great tool, but it has no hard enforcement mechanisms (it runs a persistent alert to get folks to apply updates on their own, similar conceptually to the Apple Silicon workflow for this framework but built fully around that nudging workflow), so it won't specifically address your organization's concerns about enforced update timelines.
For what it's worth, I intend on modifying my fork of install-or-defer this week so that the update button also pushes users to System Preferences > Software Update. At least then, if the update fails, the user is notified in a more transparent way (and they aren't stuck with a floating "Updates are being installed" window"). Perhaps at the end of the deferral window, if the user still hasn't updated, I'll enforce the update using the softwareupdate command.
Pull requests are welcome if you have thoughts on improving the Install or Defer user experience. Let me know how your tests go! 😁
12.3.1 dropped yesterday. Has anyone had a chance to test and see if updates on Intel machines are working properly now?
I tested this morning on my 12.3 intel machine (attempting to update to 12.3.1) and am still having the same problem unfortunately.
Seeing this same issue on some of our Intel machines - Apple Silicon machines are working as intended. Thought it was something with softwareupdate hanging and tried running - sudo launchctl kickstart -k system/com.apple.softwareupdated but no luck on the machines in question.
TBH I think softwareupdate is a dead method to install updates :( Apple are shifting the process to MDM commands and I'm already testing a workflow of using Jamf APIs to trigger the update.
How would that work exactly?
Apple is no longer supporting macOS Monterey beyond security patches, and they recommend moving to the current macOS release to receive bug fixes related to software updates. Going to close this out, but if you encounter similar issues in macOS Sonoma, please submit a new issue for tracking.
Hey,
Love the new script and Config Profile. I noticed that my computers get to last stage of "Installing updates..." hud which then it should restart... but it just doesn't? I know caching is no longer part of the process, so maybe this is because it is caching it which can take 20-30 min on its own?
Not sure if this process is supposed to take a while or if it's me/our devices.