Skip to content

Instantly share code, notes, and snippets.

@mems
Last active March 27, 2018 05:20
Show Gist options
  • Save mems/57a34fcf89441ae96b0d to your computer and use it in GitHub Desktop.
Save mems/57a34fcf89441ae96b0d to your computer and use it in GitHub Desktop.
Fix AdressBook errors in OSX 10.11 (fixed in OSX 10.12)

For /var/log/system.log full of errors like these ones:

kernel[0]: Sandbox: com.apple.Addres(XXXXX) deny(1) network-outbound /private/var/run/mDNSResponder
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
com.apple.AddressBook.InternetAccountsBridge[XXXXX]: dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:4 Err:-1 Errno:1 Operation not permitted

How to fix it?

Require SIP disabled and root access:

  1. update /System/Library/Sandbox/Profiles/application.sb (see below)
  2. delete /Users/mems/Library/Containers/com.apple.AddressBook.InternetAccountsBridge (will be regenerated based on the updated sandbox profile)
  3. kill all processes named com.apple.AddressBook.InternetAccountsBridge
  4. restart Contact.app or Mail.app

To update application.sb:

(unless
  (or (entitlement "com.apple.security.network.client")
      (entitlement "com.apple.security.network.server")
      (entitlement "com.apple.security.print"))
  (deny network-outbound (literal "/private/var/run/mDNSResponder")))

to

(unless
  (or (entitlement "com.apple.security.network.client")
      (entitlement "com.apple.security.network.server")
      (entitlement "com.apple.security.print")
      (equal? (param "application_bundle_id") "com.apple.AddressBook.InternetAccountsBridge"))
  (deny network-outbound (literal "/private/var/run/mDNSResponder")))

Contact.app will still a bit unresponsive (spinning beach ball) when edit some contacts, but errors will stopped.

More about App Sandbox in OSX:

Refernces:

@webdevotion
Copy link

webdevotion commented Jul 6, 2016

@fanzila's solution did not work for my CardDAV server. Same issue.
But OP's ( @mems ) solution worked although I still see a beach ball when I start editing.

@GHT54
Copy link

GHT54 commented Sep 26, 2016

Could you please be more explicit as to how update /System/Library/Sandbox/Profiles/application.sb ?
What should one do with the texts starting with (unless... ? Type this in a Terminal window? But first logging into a specific directory?
Many thanks in advance.

@tweekmonster
Copy link

@fanzila's solution works for me on El Capitan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment