NSCocoaErrorDomain 4097: connection to service named com.apple.storekitagent

We had a few users reporting this issue where our app is unable to connect to StoreKit.

Failed product request from the App Store server: systemError(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitagent" UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent})

This occurs when calling Product.products(for:).

Some users mentioned they had to restart their Mac in safe mode to make the error go away, some had DNS cache issues and clearing those helped, or some found the culprit to be Adguard.

What could be causing this error as it is not very clear what's causing it?

I was able to somewhat reproduce the issue under macOS 14.3 B3 but eventually it worked.

Not sure if either of these actions helped:

  • Closed the app and relaunched it
  • Launched another subscription app (ex: Photomator), initiate a purchase, cancel it and then relaunch our app

Advice from the StoreKit team would be appreciated.

Additionally, we have a user reporting a -1008 error (NSURLErrorResourceUnavailable) on macOS. iOS is unaffected.

Does Apple even care about the MAS? It's not even able to process offer codes and now this.

I understand the App Store on macOS is far from being the goldmine it is for Apple on iOS but come on! It's a bad user experience.

Is this ever going to get fixed? Some users are unable to make any in-app purchases on the Mac App Store! It's not just our app - we asked users running into this issue to try purchasing IAP from other apps and that fails as well.

If anyone has a workaround I'd love to know about it!

NSCocoaErrorDomain 4097: connection to service named com.apple.storekitagent
 
 
Q