-
Notifications
You must be signed in to change notification settings - Fork 28
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
Found no recommended update #54
Comments
Interesting. When a Jamf Pro policy installs this payload, the script execution is kicked off from a LaunchDaemon, so I don't think the policy trigger is necessarily what's causing this. Can you try installing the package client-side and confirm it has the same behavior? Would be helpful to rule out the Jamf Pro workflow as a possible factor. Would also help to know the specific hardware model of the Mac, specifically whether it has a T1/T2 Apple Security Chip or if it's an Apple Silicon model. It's possible some update output behavior has changed in a recent Big Sur build, and I know the |
If you see it happening with manual package install, recommend enabling debug mode on the script by changing the first line to |
Sorry for the late reply. Here are some specs of one of the affected systems. System 2: System 3: When i install the package on client-side it finds updates and continues to run correctly. |
Hi there @mpanighetti . I have a similar problem as @Eliesmbr, however what I'm seeing is the machines install IoD, it recognizes pending updates and download them fine, it will run for several days while the user defers, but then at a point sometime before the force date it will run it's check and suddenly report No recommended updates available and clean itself up. However, the machine does still recognize a pending update. Here is sample log output, in this case it had been running for several days as expected, this is the end of the log and then my manual softwareupdate -l check. This specific machine is a 2018 MBP.
|
This isn't necessarily a fix, but I just released version 4.1.4 which, among other things, provides more consistent variable string protection. Recommend giving this a try, and I'd suggest trying the release unmodified on some test devices to see if it enforces restarts and updates more consistently. |
@Eliesmbr @dpertschi On an affected system, try running |
@mpanighetti Where would you suggest adding that into the code? Happy to test this for you as my pending update which was deferred has disappared again Tue Nov 23 17:09:20 GMT 2021: The next prompt is deferred until after 2021-11-23 17:10:40. |
Its either the softwareupdate LD needs a kick or for some odd reason I'm breaking out early of the IF statement on line 534
|
I'd put this kickstart right before the pending update check in |
Sorry, only just gotten around to this. I've added the kickstart section and testing now. Should know by Monday if the kickstart works or not |
@mpanighetti That hasn't worked :( Checks for recommended macOS updates, or exits if no such updates areavailable.check_for_updates () {
LOG OUTPUT |
- added function to kickstart the `com.apple.softwareupdated` service (needed to work around a macOS Big Sur+ bug where update checks hang indefinitely or incorrectly report no updates available #54) - function runs before every run of the `softwareupdate` binary - added GitHub URL to info box - standardized comment spacing
That's a bummer, but it seems like there are enough issues with stability around the |
OK, if you can think of anything else to try I'm happy to give it ago |
Happened again, seems a bit silly but would a second check_updates be worthwhile until we can ID the correct fix? Logic: If currently deferred & check_Updates returns no updates try again? Fri Jan 28 13:30:26 GMT 2022: Deferral deadline: 2022-01-31 11:16:51 |
So queried the install.log, found this snippet so the softwareupdated process genuinely could not find an update 2022-01-28 16:45:18+00 X2102825 softwareupdated[588]: Refreshing available updates from scan |
Yeah, this was my suspicion, that the update check is actually running but not seeing updates for some reason. That would seem to be a macOS bug, which isn't surprising considering more of them seem to be popping up over time. Unfortunately, this script logic only functions if it's getting consistent results from I'm going to merge the |
So I tried increasing the sleep 60 to 5 mins inside the kickstart just to ensure everything was running before the softwareupdate --list from the check_updates function but even that came up with no updates found. The odd thing is the red dot above the settings app was there when the softwareupdate --list reported no updates Mon Jan 31 18:09:47 GMT 2022: Starting install-or-defer.sh. Performing validation and error checking... |
From previous logs, it looks like you were testing this in macOS Monterey? I haven't had a chance to play with this script much in Monterey since I'm looking at the MDM command functionality as a potential future replacement, but I'm starting to tinker with it now. Hopefully will have something to report there in terms of official support soon. |
I'm not sure if the kickstart is helping or not, I'm getting lots of reports from users that the Running update box is just stuck indefinitely ####################### START OF INSTALL OR DEFER 4.1.8 ####################### |
During one of my monthly Apple calls, we discussed this issue of "inconsistancy" with the softwareupdate binary. Several customers from the Apple reps are reporting this kind of behaviour and it was hinted that /usr/libexec/mdmclient AvailableOSUpdates provided some stability. i'm currently testing the below changes to the kickstart_softwarepdated function
|
macOS 12.3 beta release notes indicate Apple's actively working on improving reliability of software update checks and update enforcement MDM commands, so hopefully we'll see some stability on the other side of that update. |
@mpanighetti Worth highlighting that your changes in V5.0.1 around deleting /Library/Preferences/com.apple.SoftwareUpdate.plist breaks for those enrolled in AppleSeed or Appel Developer programmes. Primarily because it removes the CatalogURL for seed programmes. Obviously not an issue for production devices but is it possible to add a new config profile argument for Apple Seed? Boolean true/false and if true inject in the correct CatalogURL? |
Thanks, I didn't realize the beta programs wrote values to that plist that need to persist. What is the correct CatalogURL in these cases? |
- added `CatalogURL` value retention for Macs running beta macOS releases (writes key back after deleting `/Library/Preferences/com.apple.SoftwareUpdate.plist`) #54 - differentiated variables collecting `CatalogURL` value from `/Library/Preferences` vs `/Library/Managed Preferences`
@master-vodawagner I've updated the |
Yep, I'll try testing this week. I've checked the pull commit and looks like a good way to resolve my problem |
I'm still getting this bug :( Is it possible to gleam the required information from alternative sources on the device (outside of softwareupdate) |
I'm just wondering if its worth looking at the softwareupdate --no-scan function? I know technically it could cause a bleep if the workflow occurs during 12.3 and then 12.4 gets released however its just unreliable softwareupdate --list Using some logic like New update detected by Jamf ( if ! -f $PLIST ) > run softwareupdate --list then when the default defer prompt re-appears If deferred = true ( if -f $PLIST ) > run softwareupdate --no-scan |
I like the idea, but do we have any confidence that |
My only thought there would be to scrap using softwareupdate —list when the defer prompts re-appears after 4 hours… otherwise we’ll have to start looking into log stream with sub systems and keyword searches Scenario New update detected by Jamf ( if ! -f $PLIST ) > run softwareupdate --list then when the default defer prompt re-appears run jamfHelper prompt to install or defer without invoking softwareupdate —list |
So I've been testing the below changes in the code and its been smooth sailing so far, every prompt to defer again hasn't failed or cleaned up the files etc. Move check_for_updates from line 625 to line 630 |
That seems like a simple enough change. I had moved it before defining the deferral deadline to avoid an issue where the update would take so long to cache that systems with very short deadlines (like test devices) would run out of time mid-download, but we don't cache anymore so that shouldn't be an issue. Pass over a pull request! |
This forces install or defer to call softwareupdate --list on the initial install of the PKG, subsequent execution of the script via the LaunchDaemon runtime length will bypass softwareupdate --list and use the existing information when prompting the user to defer or install.
According to Apple, this bug should no longer be present in modern releases of macOS. Since there's no action to take on older releases beyond updating to a supported macOS version, I'm going to close this out. If you encounter issues like those described here in macOS Sonoma (currently the only version of macOS receiving bug fixes beyond security patches), please create a new ticket for tracking. |
On a Macbook with version 11.3.1, the script does not find any updates, although /usr/sbin/softwareupdate --list finds updates (11.4). The log says the following:
May 28 11:26:00 Install or Defer.sh[52463] : Starting Install or Defer.sh. Performing validation and error checking...
May 28 11:26:00 Install or Defer.sh[52463] : Connection to swscan.apple.com port 443 [tcp/https] succeeded!
May 28 11:26:00 Install or Defer.sh[52463] : Validation and error checking passed. Starting main process...
May 28 11:26:00 Install or Defer.sh[52463] : No logo provided, or no image file exists at specified path. Using Software Update icon.
May 28 11:26:00 Install or Defer.sh[52463] : Max deferral time undefined, or not set to a positive integer. Using default value.
May 28 11:26:00 Install or Defer.sh[52463] : Maximum deferral time: 72h:00m:00s
May 28 11:26:00 Install or Defer.sh[52463] : Checking for pending system updates...
May 28 11:26:07 Install or Defer.sh[52463] : No recommended updates available.
May 28 11:26:07 Install or Defer.sh[52463] : Updating Jamf Pro inventory...
May 28 11:26:08 Install or Defer.sh[52463] : Retrieving inventory preferences from https://xxx/...
May 28 11:26:08 Install or Defer.sh[52463] : Locating hard drive information...
May 28 11:26:08 Install or Defer.sh[52463] : Finding extension attributes...
May 28 11:26:08 Install or Defer.sh[52463] : Locating accounts...
May 28 11:26:08 Install or Defer.sh[52463] : Locating applications...
May 28 11:26:08 Install or Defer.sh[52463] : Locating package receipts...
May 28 11:26:08 Install or Defer.sh[52463] : Searching path: /System/Applications
May 28 11:26:08 Install or Defer.sh[52463] : Locating software updates...
May 28 11:26:08 Install or Defer.sh[52463] : Locating printers...
May 28 11:26:10 Install or Defer.sh[52463] : Searching path: /Applications
May 28 11:26:15 Install or Defer.sh[52463] : Locating hardware information (macOS 11.3.1)...
May 28 11:26:19 Install or Defer.sh[52463] : Submitting data to https://xxx/...
May 28 11:26:21 Install or Defer.sh[52463] : <computer_id>107</computer_id>
May 28 11:26:21 Install or Defer.sh[52463] : Killing any active jamfHelper notifications...
May 28 11:26:21 Install or Defer.sh[52463] : Cleaning up stored plist values...
May 28 11:26:21 Install or Defer.sh[52463] : Cleaning up script resources...
May 28 11:26:21 Install or Defer.sh[52463] : mkdir: /private/tmp/install-or-defer: File exists
May 28 11:26:21 Install or Defer.sh[52463] : Script will end here.
The strange thing is that when I copy the script to the macbook and run it locally, it finds updates and continues to run correctly. When i run
sudo jamf policy -event install-or-defer
it also behaves correctly. Only when it comes from the policy triggered via check-in.I have checked the function
check_for_updates()
and see no problem. Locally it correctly reports that updates are available, but via Jamf it runs into the last else for unknown reasons and then executesexit_without_updating
.Also tested this on another macbook with version 11.3.1. This problem does not occur there.
Maybe you can give me an advice how to debug this problem.
Cheers
The text was updated successfully, but these errors were encountered: