Internal Error (1/1000); "Encountered an error fetching records"

Hi,


Help, please.


I'm receiving the message: Internal Error (1/1000); "Encountered an error fetching records".... any clue?

Replies

You most likely messed something up in your code. I would go back through it and double check if everything is the way it's supposed to be.


Thanks,


Julian

Well... the code was working... the only thing that changed was the number of records in database...

I got the same error while trying to query cloud database, i am stuck, please help.


Received error Optional(<CKError 0x1c44572e0: "Internal Error" (1/1000); "Encountered an error fetching records">) for record type "Photo"

class ViewController: UITableViewController, CloudLoaderDelegate {


var photos: [Photos]?

var privateDatabase: CKDatabase?

var matchAllPredicate: NSPredicate?


let appDelegate = UIApplication.shared.delegate as! AppDelegate


let recordDownloadBlock: (String, CKDatabase, NSPredicate, CloudLoaderDelegate) -> Void =

{

(recordType, database, predicate, delegate) -> Void in

database.fetchAllRecordZones { zones, error in

guard let zones = zones, error == nil else {

print(error!)

return

}


for zone in zones {

let query = CKQuery(recordType: recordType, predicate: predicate)

database.perform(query, inZoneWith: zone.zoneID){

results, error in

if error != nil {

delegate.didReceiveError(recordType: recordType, error! as NSError)

}

guard let results = results else {

delegate.didProcessRecords(recordType: recordType, nil)

return

}

delegate.willProcessRecords(recordType: recordType, results)

for record: CKRecord in results {

delegate.processCKRecord(recordType: recordType, record)

}

delegate.didProcessRecords(recordType: recordType, results)

}

}

}

}