Calling Realm.asyncOpen always fails with "Operation Cancelled"

412 Views Asked by At

I'm trying to asynchronously open a Realm, but it keeps failing with the error:

Error Domain=io.realm.sync Code=4 "Operation canceled" UserInfo= {NSLocalizedDescription=Operation canceled, statusCode=89}

I'm not sure why this happens, especially because it worked before (as in a few days ago).

My code looks like:

let realmURL = URL(string: "realm://\(aValidIP):\(aValidPort)/~/someRealm")
let config = Realm.Configuration(syncConfiguration: SyncConfiguration(user: aLoggedInUser,
                                                                              realmURL: realmURL))
Realm.asyncOpen(configuration: config,
                        callbackQueue: DispatchQueue.main) { (realm, error) in
                            if let error = error {
                                print(error) // <-- This error holds the one explained above
                                return
                            }
                            self.realm = realm
        }

Does someone know why the operation cancels? What are reasons for asyncOpen to fail?

0

There are 0 best solutions below