CloudKit: <CKError 0x17004c120: "Internal Error" (1/4000); "Couldn't get a signing certificate">

Hi


I have built an app which is using CloudKit. I am using Xcode 8.0 and Swift. The problem is very simple. I can't fetch any data from CloudKit database when my iPhone is connected to my home WiFi. Mobile internet works perfectly fine and other WiFis from other institutions and building are also working. Apple also rejected my app because of exactly that behaviour. They told me that the app couldn't load data when they have connected the device to a WiFi which is connected to an ipv6 network.


In the simulator on my MacBook (which is connected to the same WiFi that causes the problems) it works fine too. But when I run it through my iPhone then I always get this error:


<CKError 0x17004c120: "Internal Error" (1/4000); "Couldn't get a signing certificate">


The method that causes this error is this:


func fetchNotes() {
        let container = CKContainer.default()
        let publicDatabase = container.publicCloudDatabase
        let date = Date(timeInterval: -60.0 * 60 * 24 * 7, since: Date())
        let predicate = NSPredicate(format: "creationDate > %@", date as CVarArg)
  
        let query = CKQuery(recordType: "Images", predicate: predicate)
        query.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)]
  
        publicDatabase.perform(query, inZoneWith: nil) { (results, error) -> Void in
            if error != nil {
                print(error) // it lands here and the error gets printed.
            }
            else {
                // work with the results...
            }
        }
    }


Is this because of the ipv6 WiFi? How can I fix this problem or is CloudKit not compatible with ipv6?


I would be very happy if someone could help me 🙂


Update:


I just tried a completely new project with a new CloudKit container and just put the method above to test if I am able to fetch data from CloudKit and I get exactly the same error on my device when connected to my WiFi (my WiFi works by the way 😉 ). And in the simulator it works nice. What could be causing this problem?

The project is deployed for iOS 9.3 and I created it using Xcode 8.0.

Replies

What we'll need is to get a bug report, and for you to include logs from a device exhibiting the behavior. You can use the iCloud Drive & CloudKit logging profile found here: Profiles and Logs. Please post the bug number here so we can follow up.

Thank you for the reply. I have started a bug report with this number 28467749.

I just updated the bug report with yet another new information (still the same bug report number: 28467749)


This is the new message:

"I just found out that when I initially start the app with mobile internet to be able to successfully load CloudKit data and then after turn on WiFi, it keeps working then with the WiFi. It then also loads from CloudKit with the WiFi. So this problem can't be my WiFi or my IP... This must be something else... The initial connection of CloudKit fails with my WiFi. Is this a CloudKit/Server problem?"

Hey Akan


I am having the exact same issue with my App. It was working before and out of a sudden I cannot retrieve the data when I am using the internal WIFI at my company. Without WIFI in the mobile network it is working correctly as before. Did you found a solution yet?

Hi Prine I still have the problem on my WiFi. I also contacted the technical Apple support and he replied today that it looks like a temporary CloudKit server issue. My app now got accepted because I told the App Store guys about the issue. Just make sure that the app can handle the issue correctly and maybe inform the user about a "temporary server issue".

Ok now it is working again. Thanks :)