Error OSSystemExtensionErrorDomain Code=4 "(null)"

When my macOS app try to deactivate CameraExtension, my app's didFailWithError is called with this error.

Error Domain=OSSystemExtensionErrorDomain Code=4 "(null)"

I cannot search for error code=4 with that domain.

MyApp calls OSSystemExtensionManager.shared.submitRequest with OSSystemExtensionRequest.deactivationRequest

I did implement these tasks.

  • BundleID, MyApp: com.myapp,
  • BundleID, CameraExtension: com.myapp.camera
  • Added entitlement and App Groups for app and extension
  • MyApp has SystemExtension capability on Xcode and provision
  • MyApp is installed on /Applications/MyAppGroup/MyApp.app
  • MyApp is executed by Finder

macOS is Sonoma 14.2.1 (23C71) on M1 MacBook

I think this error is OSSystemExtensionErrorExtensionNotFound, from <SystemExtensions/SystemExtensions.h>.

I see this error also when I try to deactivate my camera extension (after approving its removal with the OS' dialog), but I'm running on a laptop with a built-in, non-removable camera. Maybe the error doesn't happen if there are no cameras in the system, so my extension can be unloaded.

I don't know and don't particularly care, because in our shipping apps we never make a deactivationRequest. It isn't clear to me what that API is for - as far as the user is concerned, the driver is installed because they installed its host app and approved it.

I made sure my camera extension is installed and activated

With command "systemextensionsctl list" and my camera extension is listed with "[activated enabled]"

Host app calls API OSSystemExtensionManager.shared.submitRequest with OSSystemExtensionRequest.propertiesRequest. OSSystemExtensionRequestDelegate.foundProperties is called with my extension's bundle ID.

In some condition, like kill app pocess during OSSystemExtensionManager.shared.submitRequest(), CameraExtension go into unstable condition. Normal uninstall is not possible.

I need to do

  • Reboot MacBook with recovery mode
  • run "csrutil disatble"
  • Reboot
  • run "systemextensionsctl uninstall [teamID] [BundleID]"
  • Reboot with recovery mode
  • run "csrutil enable"
  • Reboot

If you have a reproducible process for getting your Mac into this state, please do file a bug about it. This sort of hoop jumping shouldn’t be necessary.

I’d appreciate you postingf your bug number, just for the record.

Share and Enjoy

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

Error OSSystemExtensionErrorDomain Code=4 "(null)"
 
 
Q