Acknowledged
CIQQA-3721

The proxy server servicing makeImageRequest() cannot resolve domain name

I previously described this error in this thread:
The error still persists.

URLs for verification:
https://akniga.org/uploads/media/topic/2025/11/26/08/preview/f9bda153ad2598189dca_400x.jpg
https://akniga.org/uploads/media/topic/2025/11/30/17/preview/f047d7022f60742472f4_400x.jpg
https://akniga.org/uploads/media/topic/2025/11/30/10/preview/c2a5ee4871a2d8e8624f_400x.jpg

Parents
  • It looks like you're right. It might not be a DNS issue.
    I wrote a verification code. It loads three images. Each link opens correctly in the browser.
    The first link is needed to verify that my code is working correctly.
    The other two are examples of failed image retrieval directly from the site and through my proxy.
    In the proxy logs, I see the request and successful transfer of the image to the Garmin server. Interestingly, the error codes for retrieval directly and through the proxy are different.

    import Toybox.Communications;
    import Toybox.Lang;
    import Toybox.System;
    import Toybox.Media;
    import Toybox.Time;
    import Toybox.Application;
    
    class AbooksSyncDelegate extends Communications.SyncDelegate {
      var links = null;
      var index = null;
    
      function initialize() {
        SyncDelegate.initialize();
        links = [];
        // A good link for checking the correctness of the code
        links.add(
          "https://habrastorage.org/r/w780/getpro/habr/upload_files/713/a92/5a8/713a925a8f41db887179e66cb822f201.jpg"
        );
        // Direct link to the image. Doesn't work, although accessible from the browser.
        links.add(
          "https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp"
        );
        // The previous link is accessed through the my proxy. Doesn't work, although accessible from the browser.
        // In the proxy logs, I see that the image was successfully sent to the Garmin server.
        links.add(
          "https://fv.n-drive.cf/audiobookshelf/cover?url=https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp"
        );
      }
    
      function onStartSync() {
        index = 0;
        startLoadingCovers();
      }
    
      function startLoadingCovers() {
        if (index < links.size()) {
          var url = links[index];
          System.println("start: " + url);
          var options = {
            :maxWidth => 100,
            :maxHeight => 100,
            :dithering => Communications.IMAGE_DITHERING_FLOYD_STEINBERG,
            :packingFormat => Communications.PACKING_FORMAT_JPG,
          };
    
          Communications.makeImageRequest(
            url,
            {},
            options,
            self.method(:onWebResponse)
          );
        }
      }
    
      function onWebResponse(code, data) {
        System.println("code: " + code);
        System.println("data: " + data);
    
        index += 1;
        startLoadingCovers();
      }
    
      function isSyncNeeded() as Boolean {
        return true;
      }
    
      function onStopSync() as Void {
        Communications.cancelAllRequests();
        Communications.notifySyncComplete(null);
      }
    }

    console:

    start: https://habrastorage.org/r/w780/getpro/habr/upload_files/713/a92/5a8/713a925a8f41db887179e66cb822f201.jpg
    code: 200
    data: Obj: 218
    start: https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp
    code: 404
    data: null
    start: https://fv.n-drive.cf/audiobookshelf/cover?url=https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp
    code: 400
    data: null

Comment
  • It looks like you're right. It might not be a DNS issue.
    I wrote a verification code. It loads three images. Each link opens correctly in the browser.
    The first link is needed to verify that my code is working correctly.
    The other two are examples of failed image retrieval directly from the site and through my proxy.
    In the proxy logs, I see the request and successful transfer of the image to the Garmin server. Interestingly, the error codes for retrieval directly and through the proxy are different.

    import Toybox.Communications;
    import Toybox.Lang;
    import Toybox.System;
    import Toybox.Media;
    import Toybox.Time;
    import Toybox.Application;
    
    class AbooksSyncDelegate extends Communications.SyncDelegate {
      var links = null;
      var index = null;
    
      function initialize() {
        SyncDelegate.initialize();
        links = [];
        // A good link for checking the correctness of the code
        links.add(
          "https://habrastorage.org/r/w780/getpro/habr/upload_files/713/a92/5a8/713a925a8f41db887179e66cb822f201.jpg"
        );
        // Direct link to the image. Doesn't work, although accessible from the browser.
        links.add(
          "https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp"
        );
        // The previous link is accessed through the my proxy. Doesn't work, although accessible from the browser.
        // In the proxy logs, I see that the image was successfully sent to the Garmin server.
        links.add(
          "https://fv.n-drive.cf/audiobookshelf/cover?url=https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp"
        );
      }
    
      function onStartSync() {
        index = 0;
        startLoadingCovers();
      }
    
      function startLoadingCovers() {
        if (index < links.size()) {
          var url = links[index];
          System.println("start: " + url);
          var options = {
            :maxWidth => 100,
            :maxHeight => 100,
            :dithering => Communications.IMAGE_DITHERING_FLOYD_STEINBERG,
            :packingFormat => Communications.PACKING_FORMAT_JPG,
          };
    
          Communications.makeImageRequest(
            url,
            {},
            options,
            self.method(:onWebResponse)
          );
        }
      }
    
      function onWebResponse(code, data) {
        System.println("code: " + code);
        System.println("data: " + data);
    
        index += 1;
        startLoadingCovers();
      }
    
      function isSyncNeeded() as Boolean {
        return true;
      }
    
      function onStopSync() as Void {
        Communications.cancelAllRequests();
        Communications.notifySyncComplete(null);
      }
    }

    console:

    start: https://habrastorage.org/r/w780/getpro/habr/upload_files/713/a92/5a8/713a925a8f41db887179e66cb822f201.jpg
    code: 200
    data: Obj: 218
    start: https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp
    code: 404
    data: null
    start: https://fv.n-drive.cf/audiobookshelf/cover?url=https://akniga.org/uploads/media/topic/2025/11/28/23/preview/252ddce3185c910fdbb1_400x.webp
    code: 400
    data: null

Children
No Data