small medium large xlarge

Generic-user-small
17 Oct 2017, 15:01
Robert Saccone (2 posts)

Hello Marcus,

I have both editions of your book and have found them to be invaluable in my day to day work. In my current project I am running into an issue where Xcode is spitting out the following error to the console:

CoreData error: API Misuse: Attempt to serialize store access on non-owning coordinator (PSC = 0x174262940, store PSC = 0x0)

There’s very few hits on this message out that I’ve found. I’ve tried posting on the Apple Developer Forum where I haven’t received any response. I am looking for ways to get to the bottom of this. Here’s some details.

I can’t seem to pin down the specific operations that are causing it. It almost seems like it is something that Core Data is emitting at some point after whatever the offending operation is.

The Core Data setup in the app is done using a UIManagedDocument and in addition I am adding some private queue concurrency contexts where the parent is the managed context in the document (which is the main). Auto save of the UIManagedDocument is turned on. In addition at certain points the app is also doing explicit save of these private contexts. I don’t see any ill affects due to the message but I would like to get to the bottom of the issue.

I did do searching and there was an old posting where someone fixed it by saving their managed context before using a fetched results controller it was associated with. This seems wrong to me as having to a do a save before using the fetched results controller might catch updates to the managed objects that are in the middle of being made and aren’t ready for saving yet because a save could end up violating a relationship constraint.

Someone also suggested to make sure the entities were being created with NSEntityDescription.insertNewObject which I double checked that they are.

I have -com.apple.CoreData.ConcurrencyDebug set to 1 and when there were other concrrency issues it helped. However with this particular situation it just emits the message and continues. Is there a way to get Core Data to break in the debugger for his message?

Any ideas on how I might get to the bottom of this issue or settings I can enabled are greatly appreciated.

Thanks, Rob

Avatarsmall_pragsmall
18 Oct 2017, 00:04
Marcus S. Zarra (284 posts)

Rob,

I have never run into that error before!

The solutions you found seem … wrong to me. An FRC should not have any impact on store access if the FRC is running on the UI thread.

I would suggest filing. radar against this or opening a developer ticket so that you can hopefully get a solution directly from the horse.

Generic-user-small
18 Oct 2017, 01:03
Robert Saccone (2 posts)

Thanks Marcus for your suggestion.

I will file a radar.

Regards, Rob

You must be logged in to comment