HTTP load failed (error code: 310 )


#1

Add this to viewDidLoad in ViewController

    let defaultPath = Realm.Configuration.defaultConfiguration.fileURL?.path
        print(defaultPath ?? "no path")
        do {
            let realm = try Realm()
            print(realm.configuration.fileURL?.absoluteString ?? "no path")
        } catch let error {
            print("failed: \(error.localizedDescription)")
        }

The console said:

2018-04-07 12:05:47.474824+0800 TestRealm[5567:151577] 
Task <1488FB8B-1A8C-4431-B20A-142D9C26B4EF>.<2> HTTP load failed (error code: 310 [4:-2096])
2018-04-07 12:05:47.475056+0800 TestRealm[5567:151579] 
Task <1488FB8B-1A8C-4431-B20A-142D9C26B4EF>.<2> finished with error - code: 310

How to fix it ?