Random timed out error on app start

I am getting the following error randomly when launching the app on my device with the debugger on.

Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2103, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <EDA8D402-B117-45D5-B113-AC1CF4866669>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

    "LocalDataTask <EDA8D402-B117-45D5-B113-AC1CF4866669>.<1>"

), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://www.apple.com/library/test/success.html, NSErrorFailingURLKey=https://www.apple.com/library/test/success.html, _kCFStreamErrorDomainKey=4}

I also managed to reproduce it with this simple code.

let sessionConfiguration = URLSessionConfiguration.default
sessionConfiguration.requestCachePolicy = .reloadIgnoringCacheData
sessionConfiguration.timeoutIntervalForRequest = 5.0
sessionConfiguration.timeoutIntervalForResource = 5.0
let session = URLSession(configuration: sessionConfiguration)
let task = session.dataTask(
   with: URLRequest(url: .init(string: "https://www.apple.com/library/test/success.html")!)) { data, response, error in
   if let error = error {
     print(error)
   }
 }
 task.resume()

What does this error code mean? _kCFStreamErrorCodeKey=-2103

What does this error code mean?

-2103 is an internal error that translates to ‘resource timeout’

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Random timed out error on app start
 
 
Q