failing XPC connection to SMAppService based LaunchDaemon on some macOS 26 Macs ("FATAL ERROR - fullPath is nil"?)

our app has a helper to perform privileged operations which communicates with the main app via xpc_connection*

previously that helper was installed via SMJobBless() into the /Library/LaunchDaemons/ and /Library/PrivilegedHelperTools/

due to various issues with the old SMJobBless() as well as it being deprecated we have ported the helper to the new SMAppService API where the helpers do not need to be installed but remain within the app bundle ( [[SMAppService daemonServiceWithPlistName:HELPER_PLIST_NAME] registerAndReturnError:&err] )

the new approach has been used in production for a year now and works fine in most cases and seems to be more reliable than the old SMJobBless().

however, we've observed two problems with the new helper architecture.

• sometimes when users update the app (with the built-in Sparkle framework), the app does not seem to have FullDiskAccess, although the checkbox in the system settings remains toggled on. only once the Mac has been restarted, things work fine again. since this is cured by a reboot, lets ignore this issue

• on some Macs, it just seems impossible to use the helper, while "installation" via SMAppService runs fine without error, using the helper always just fails with Connection invalid. This issue seems to affect ~0.2% of our users Macs, and we have found no cure yet how to get things into a working state on those Macs. luckily the issue also occurs 100% reproducible on one of the Macs in our office now. the problem seems to be a regression in macOS 26, as things worked absolutely fine on all previous macOS versions.

we'd like to investigate why the helper just won't work on some Macs. unfortunately even enabling Console logging for just a few seconds yields thousands of messages nowadays, but this may be insightful: we found that on the "bad Mac", the "FATAL ERROR - fullPath is nil" always appears and subsequently no working XPC connection to the helper is ever established. on the "good Macs", this "fullPath is nil" error never appears, and the XPC connection works fine after all the required permissions (helper permission, FDA permission) are granted.

so, my questons:

• has anyone else seen a problem where a SMAppService / XPC based priviledged helper just won't work on a handful of Macs?

• what about the "FATAL ERROR - fullPath is nil", is this the real root cause of the issue or should we look somewhere else? how can we prevent the issue on the affected Macs?

the only thing that seems to be clear here is that this is a macOS 26 Tahoe bug.

Answered by DTS Engineer in 873059022
since this is cured by a reboot, lets ignore this issue

Well, it’d be good to get a bug on file about that. If you see it on a machine you control, please grab a sysdiagnose log before and after the restart and file a bug describing the issue with those logs attached.

And please post your bug number, just for the record.


Regarding your main issue, you wrote:

the only thing that seems to be clear here is that this is a macOS 26 Tahoe bug.

That does seem likely. I’d like to get a bug on file about that too. So, something like this:

  1. Restart the Mac, just to clear away any cruft.
  2. Reproduce the problem, noting down the time.
  3. Grab a sysdiagnose shortly thereafter.
  4. File a bug with that sysdiagnose log, a general description of the problem, and the rough timestamp from step 2.

Once you’re done, please post your bug number.

If you want to dig into this yourself, you can do that using the sysdiagnose itself. Critical, it contains a log snapshot, system_logs.logarchive, which has some key advantages:

  • It’s a full fidelity snapshot of the log.
  • It’s not changing all the time, so you can investigate at your own pace.
  • You can use Console, and various other tools, to run structured queries on the log.

I have a bunch more hints and tips about working with the system log in Your Friend the System Log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Log output in the "good case"

error	16:19:36.784221+0000	MacUpdater	Info: installHelperTool=>install called in response to 'install helper' button click
default	16:19:36.793426+0000	backgroundtaskmanagementd	effectiveItemDispositionWithAuditToken: pid=1133, type=daemon, url=Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist -- file:///, config={BTMConfigArguments =     ();BTMConfigBundleIdentifiers =     ();BTMConfigExecutablePath = "Contents/Resources/com.corecode.MacUpdaterPrivilegedInstallHelperTool2";BTMConfigLabel = "com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigSHA256Checksum = {length = 32, bytes = 0xdb895cbb 550e1cf7 1174e785 98817f14 ... 36a73b15 dcffc6cc }; }
default	16:19:36.812777+0000	backgroundtaskmanagementd	effectiveItemDisposition: appURL=file:///Applications/MacUpdater.app/, type=daemon, url=Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist -- file:///, config={BTMConfigArguments =     ();BTMConfigBundleIdentifiers =     ();BTMConfigExecutablePath = "Contents/Resources/com.corecode.MacUpdaterPrivilegedInstallHelperTool2";BTMConfigLabel = "com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigSHA256Checksum = {length = 32, bytes = 0xdb895cbb 550e1cf7 1174e785 98817f14 ... 36a73b15 dcffc6cc };}
error	16:19:36.812838+0000	backgroundtaskmanagementd	effectiveItemDisposition: record not found: appURL=/Applications/MacUpdater.app, url=/Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist, type=daemon, config={ BTMConfigArguments =     ( );BTMConfigBundleIdentifiers =     (); BTMConfigExecutablePath = "Contents/Resources/com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigLabel = "com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigSHA256Checksum = {length = 32, bytes = 0xdb895cbb 550e1cf7 1174e785 98817f14 ... 36a73b15 dcffc6cc }; }
default	16:19:36.813157+0000	MacUpdater	Service <private> status: 3
…
default	16:19:54.185694+0000	MacUpdater	[0x9e18c0c80] activating connection: mach=true listener=false peer=false name=com.corecode.MacUpdaterPrivilegedInstallHelperTool2
default	16:19:54.186103+0000	com.corecode.MacUpdaterPrivilegedInstallHelperTool2	[0x74acb4180] activating connection: mach=false listener=false peer=true name=com.corecode.MacUpdaterPrivilegedInstallHelperTool2.peer[1133].0x74acb4180
…

Log output in the "bad case"


error	16:40:03.112823+0100	MacUpdater	Info: installHelperTool=>install called in response to 'install helper' button click
default	16:40:03.124697+0100	backgroundtaskmanagementd	effectiveItemDispositionWithAuditToken: pid=19798, type=daemon, url=Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist -- file:///, config={ BTMConfigArguments =     ( ); BTMConfigBundleIdentifiers =     ( ); BTMConfigExecutablePath = "Contents/Resources/com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigLabel = "com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigSHA256Checksum = {length = 32, bytes = 0xdb895cbb 550e1cf7 1174e785 98817f14 ... 36a73b15 dcffc6cc };}
default	16:40:03.141046+0100	backgroundtaskmanagementd	effectiveItemDisposition: appURL=file:///Applications/MacUpdater.app/, type=daemon, url=Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist -- file:///, config={ BTMConfigArguments =     ( ); BTMConfigBundleIdentifiers =     ( ); BTMConfigExecutablePath = "Contents/Resources/com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigLabel = "com.corecode.MacUpdaterPrivilegedInstallHelperTool2"; BTMConfigSHA256Checksum = {length = 32, bytes = 0xdb895cbb 550e1cf7 1174e785 98817f14 ... 36a73b15 dcffc6cc }; }
error	16:40:03.141098+0100	backgroundtaskmanagementd	effectiveDisposition: FATAL ERROR - fullPath is nil, container=(null), item=uuid=753BC2AC-6854-4F5D-B556-80A605739848, name=com.corecode.MacUpdaterPrivilegedInstallHelperTool2, type=daemon, disposition=[disabled, disallowed, notified], identifier=16.com.corecode.MacUpdaterPrivilegedInstallHelperTool2, url=Contents/Library/LaunchDaemons/com.corecode.MacUpdaterPrivilegedInstallHelperTool2.plist -- file:///
default	16:40:03.141324+0100	MacUpdater	Service <private> status: 0
…
default	16:40:18.433378+0100	MacUpdater	[0x91edf6300] activating connection: mach=true listener=false peer=false name=com.corecode.MacUpdaterPrivilegedInstallHelperTool2
default	16:40:18.433536+0100	MacUpdater	[0x91edf6300] failed to do a bootstrap look-up: xpc_error=[3: No such process]
default	16:40:18.433548+0100	MacUpdater	[0x91edf6300] invalidated after a failed init
error	16:40:18.497570+0100	MacUpdater	testConnection: exiting with ERROR  0x20a8d0c30 <dictionary: 0x20beb7c10> { count = 1, transaction: 0, voucher = 0x0, contents =	"XPCErrorDescription" => <string: 0x20beb7d58> { string cache = 0x0, length = 18, contents = "Connection invalid" }}
…

good logfile attached

bad logfiles here (too large to attach, bah)

https://230402id2zpmvv4ytt6.nextcloud.hosting.zone/s/gJzsxWR3JrMt6G9

since this is cured by a reboot, lets ignore this issue

Well, it’d be good to get a bug on file about that. If you see it on a machine you control, please grab a sysdiagnose log before and after the restart and file a bug describing the issue with those logs attached.

And please post your bug number, just for the record.


Regarding your main issue, you wrote:

the only thing that seems to be clear here is that this is a macOS 26 Tahoe bug.

That does seem likely. I’d like to get a bug on file about that too. So, something like this:

  1. Restart the Mac, just to clear away any cruft.
  2. Reproduce the problem, noting down the time.
  3. Grab a sysdiagnose shortly thereafter.
  4. File a bug with that sysdiagnose log, a general description of the problem, and the rough timestamp from step 2.

Once you’re done, please post your bug number.

If you want to dig into this yourself, you can do that using the sysdiagnose itself. Critical, it contains a log snapshot, system_logs.logarchive, which has some key advantages:

  • It’s a full fidelity snapshot of the log.
  • It’s not changing all the time, so you can investigate at your own pace.
  • You can use Console, and various other tools, to run structured queries on the log.

I have a bunch more hints and tips about working with the system log in Your Friend the System Log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

thanks. the issue was 100% reproducible on this Mac for at least 3 months (maybe since Tahoe installation?) across dozens of reboots.

i've generated the log files of the failures just 2 days ago.

but the funny thing is, i just tried to reproduce it again because you requested the sysdiagnose logs and ... today the issue is gone. the helper now works just fine on this Mac too.

so, unless the log files i already have are enough, i cannot contribute more to get this resolved. the logfiles are quite comprehensive, its nearly 2 MB text...

But the funny thing is, I just tried to reproduce it again because you requested the sysdiagnose logs and ... today the issue is gone. The helper now works just fine on this Mac too.

This is speculative, but this is a kind of thing that happens when there are issues with the LaunchServices database. That database is how the system maps bundle IDs to file system locations, which can obviously be a problem if/when "something" goes wrong in the database. These issues often have exactly the kind of pattern you’re describing— something "stays" broken quite persistently, then suddenly starts working for "no" apparent reason. I have an extended post about this sort of issue here, however, the two points I’d pull from that post:

  1. While I've seen these issues happen to many developers, they're much, MUCH rarer on end-user systems. The unique dynamics of the development process are the single biggest factor here.

  2. The fact this "keeps happening" is a side effect of LaunchServices’ basic role, NOT a lack of attention or maintenance. The nature of LaunchServices’ role in the system means that it really only "fails" in one way ("something wasn't found, didn't launch, etc..."), which means lots of unrelated failures end up looking exactly the same.

In any case, the big suggestion I'd have for SMAppService in particular is that if you both "use" your app (as a "normal" user would) AND actively develop it, you may want to consider having separate "development" and "production" bundle IDs. A lot of these issues happen because the "churn" of the build/test/build cycle means that you’re producing "new" apps FAR faster than any normal ever would, creating more opportunity for things to go wrong. This also has the advantage of helping avoid odd testing/development-only bugs. For example, I've seen a few different cases where production and development builds ended up talking to the XPC components of the "other" app, creating weird fails that would otherwise have never occurred. That's not something that would ever happen on end-user machines and it's easy to accidentally waste a few hours investigating a "bug" that's never actually going to happen.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

What Kevin said, obviously (-:

i just tried to reproduce it again … today the issue is gone.

Bah!

so, unless the log files i already have are enough

That’s unlikely. A sysdiagnose log captures a bunch of state. That includes a system log snapshot, but it includes other state that’s not directly encoded in the log. The chances of a bug getting traction without that log is… well… it’s not impossible, but it’s significantly reduced.

There’s a lesson to be learnt here, namely grab sysdiagnose logs early and often (-:

If you don’t see the problem again internally, you can still ask your customers to take a sysdiagnose log themselves. It’s relatively easy for them to do. They can either pass it along to you or, if they’re not comfortable with that, file their own bug in Feedback Assistant and pass you the bug number.

I expand on this idea in Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

failing XPC connection to SMAppService based LaunchDaemon on some macOS 26 Macs ("FATAL ERROR - fullPath is nil"?)
 
 
Q