none
Blob not returned (749bytes of data are though) but no error

    Question

  • I have an IOS8 app using azure storage blobs for jpg photos. My issue is when retrieving the blobs for display.

    Most of the time they are retrieved fine. But just occasionally an odd one will not be returned. Instead 749 bytes are returned but with error still = nil.

    Now that would be fine, no problem really. However EVERY time after that when I try to retrieve that blob again then the same issue occurs. All the surrounding blobs are returned fine. The blob in question is fine and can be retrieved healthily via the web or other installed apps.

    I have spent lots of time clearing all variables involved and recalling the blob in question and no matter what only ever 749 bytes are returned. Deleting the app from the device and reinstalling it is the only workaround!

    So I presume Azure storage or mobile services think the returned data was ok (since it had no error) and keeps sending the same - how can I prevent that and demand a true retry?

    Sunday, June 21, 2015 8:37 PM

Answers

  • ISSUE SOLVED via stack overflow response from AdamSorrin:

    "look at the NSURLSessionConfiguration documentation, specifically requestCachePolicy My guess is that you're getting stale data from the cache when you try and re-fetch the contents of the blob. You can use this parameter to force the request to re-fetch the data from the service"

    Monday, June 22, 2015 11:31 PM

All replies

  • Hi,

    I am assuming the image got correupted either when it got stored into the databae or when it is retrieved from the database.

    Have you already deleted the app and reinstalled it ? Is the Blob returned with out any issues in this scenario ?

    Are you Serving images or documents directly to a browser ? Is it the same blob image ever where the 749 bytes are returned with no error ?

    When you say 749 bytes are returned, what does that contain ? could you share the screen shot of it.

    Regards,

    Shirisha Paderu

    Monday, June 22, 2015 3:40 PM
    Moderator
  • Hi, thank-you for replying as I am really stuck!

    I'm certain the blob/image itself is not corrupted. After this happens I can (a) download and preview it ok from the blob storage using my azure portal, (b) uninstall my IOS app from my device, reinstall the app and then retrieve the blob in question just fine.

    In general my app shows a long list of photos with the most recent at the top. Usually I can log in and out and see the photos retrieved well & populated into the tableview cells (I do not persist them into core data etc) - then randomly a single one (not the same one each time) will not be retrieved.

    As I say I don't really mind that as I can just re-try e.g I expect timeout sometimes etc BUT any repeat request will always then return the same 749 bytes

    The bytes returned will not error when I try to convert them into a UIImage for display - but the 'photo' will just be plain white.

    Kind regards,

    Charlotte


    Monday, June 22, 2015 7:15 PM
  • ISSUE SOLVED via stack overflow response from AdamSorrin:

    "look at the NSURLSessionConfiguration documentation, specifically requestCachePolicy My guess is that you're getting stale data from the cache when you try and re-fetch the contents of the blob. You can use this parameter to force the request to re-fetch the data from the service"

    Monday, June 22, 2015 11:31 PM