Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Setting image through SdWebImage gives “Error code=-1003” and using CFNetwork Diagnostics log "Err(-65554)"

Ask Question
    [cell.i_imageView 
sd_setImageWithURL:[NSURL URLWithString: item.imageUrl] 
    placeholderImage:[UIImage imageNamed:@"no-image"] 
    options: SDWebImageRefreshCached 
    completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
           if(!image)
               NSLog(@"image not loaded %@", error.description);

In most cases the image loads fine, but sometimes in SDwebimage's completion handler when it fails, it gives these error messages "Error code=-1003" and upon using CFNetwork Diagnostics log it gives "Err(-65554)".

After much research I have found out it's a DNS-related issue and have tested this theory out by using the following methods,

  • Use VPN on an actual device
  • Disconnect the WIFI and use Cellular data
  • To these aforementioned techniques the images reloads again, but I can't be betting on both these above mentioned methods while shipping the product, so any NSURLSession calls, SdWebImage methods that I might missing here that solves the problem, or maybe a way to turn cellular data on for these specific URLs

    -1003 is NSURLErrorCannotFindHost error. Common error when there is no internet connection. – Cy-4AH Sep 19, 2019 at 15:54

    Turns out it was an issue of using cooperate Wifi ISP which had these reservations with some URLs that were been test, only thing that was needed -- reconnect to new different Wifi or use cellular.

    It was never related to SDWebimage

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.