Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 12 won't actually restart and install the update #76

Closed
adonboli opened this issue Feb 11, 2022 · 26 comments
Closed

macOS 12 won't actually restart and install the update #76

adonboli opened this issue Feb 11, 2022 · 26 comments
Assignees
Labels

Comments

@adonboli
Copy link

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.

@mpanighetti
Copy link
Owner

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.

@mpanighetti mpanighetti self-assigned this Feb 12, 2022
@bananafranco
Copy link

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.

@romnation1
Copy link

I am experiencing the same behavior. Tested on multiple intel Monterey machines

@K3ll3r
Copy link
Contributor

K3ll3r commented Feb 14, 2022

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.}
}}

@romnation1
Copy link

romnation1 commented Feb 14, 2022

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.
Screen Shot 2022-02-14 at 3 40 45 PM

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.

@romnation1
Copy link

Intel mac now does find the update but still stuck with the same issue, hanging after password entry.

@romnation1
Copy link

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)

@mpanighetti
Copy link
Owner

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.

@master-vodawagner
Copy link

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

@mpanighetti
Copy link
Owner

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.

@dv8nrg
Copy link

dv8nrg commented Feb 23, 2022

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!

@dv8nrg
Copy link

dv8nrg commented Feb 25, 2022

Can someone please advise if possible?

@mpanighetti
Copy link
Owner

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.

@romnation1
Copy link

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.

@mpanighetti
Copy link
Owner

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.

@romnation1
Copy link

Looks like the official 12.3 dropped today.

@mpanighetti
Copy link
Owner

Yep, and 11.6.5 which will hopefully bring relief for #54. 🤞🏻

@romnation1
Copy link

romnation1 commented Mar 14, 2022

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.

@K3ll3r
Copy link
Contributor

K3ll3r commented Mar 14, 2022 via email

@mpanighetti
Copy link
Owner

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! 😁

@romnation1
Copy link

12.3.1 dropped yesterday. Has anyone had a chance to test and see if updates on Intel machines are working properly now?

@romnation1
Copy link

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.

@memile123
Copy link

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.

@master-vodawagner
Copy link

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.

@Frankie24
Copy link

How would that work exactly?

@mpanighetti
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants