XPC_ERROR_CONNECTION_INVALID error when talking with helper app over XPC

hello all,


as per Apple's recommendations, we have seperated our root-level functionality of deleting files into a seperate helper app that is installed globally via SMJobBless() to /Library/PrivilegedHelperTools & /Library/LaunchDaemons.


at launch our app (UninstallPKG) creates a XPC connection to the helper (xpc_connection_create_mach_service() ) and when it needs to delete a file it sends a message to the helper app ( xpc_connection_send_message_with_reply_sync() ) which then performs its task.


this works perfectly well on all our test machines, and for most of our customers. however, it seems like some users are constantly encountering 'XPC_ERROR_CONNECTION_INVALID' failures. does anyone have any clue why this happens for some customers and how we could handle or prevent this problem? barring more information about what 'XPC_ERROR_CONNECTION_INVALID' actually means, we currently just quit the app, which is just as bad as a crash.


google or apple's documentation or sample code reveals little about under what circumstances 'XPC_ERROR_CONNECTION_INVALID' could be encountered and how it should be gracefully handles. any insights would be appreciated. if Apple is serious about this priviledge separation thing, documentation on how to do so reliably should really be improved.


btw to a lesser extent we are also seeing 'XPC_ERROR_CONNECTION_INTERRUPTED' out in the wild. we are currently just ignoring it. any insights on this one?

thanks, julian

Replies

I'm getting the XPC_ERROR_CONNECTION_INVALID with the mdworker process while doing time machine backups (since ElCap update), too.

I am having this same issue. I wasn't having it prior to going form the 10.11.2 beta to the 10.11.1 update that came down the pipe today. I have tried all of the above solutions, but nothing has worked. I am nearing the desire to completely reload the Mac from a fresh start.