I'm getting a 404 (or other 40x errors) for my transformed image while other versions of that image work

Follow

Comments

36 comments

  • Avatar
    Ramon Kool

    Hi there, I have the same issue as MB... even though this thread gives some insight, it doesn't give a solution. Renaming the file shortly after uploading (I do the exact same thing as MB), gives a 404 via the server. I tried using with or without versioning to show the image, but it just doesn't show. In the media library it does show however. I'm using the React component to show the image. Any information would be greatly appreciated. :)

    0
    Comment actions Permalink
  • Avatar
    Roee Ben Ari

    Hi Ramon, 

    Would you mind sharing the URL you're trying to access so I can check the logs to better understand the issue?

    If you rather keep it private, then please feel free to open a support ticket and we'll continue from there. 

    Thanks!
    Roee

    0
    Comment actions Permalink
  • Avatar
    Ramon Kool

    And now when I click the links I just gave... they work... but they didn't after uploading :(

    0
    Comment actions Permalink
  • Avatar
    differential enterprises

    the thing that worked for us was to put a slightly different image width / height in the image retrieve url, each time you check for / pull the image

    if you happen to try to pull the image before it is ready, you are toast for a while...can't get the image even if it is ready.  on that exact same url.

    e.g. dont try to pull the exact same url each time

    maybe changing other args would work too instead of width height, but this was good enough for us

    e.g. the %d %d placeholders here iare filled in with slightly different integers (C format statement)

    https://res.cloudinary.com/XXXXXXXXX/image/upload/h_%d,w_%d/restofpath.jpg

    it is maddening problem.  AWS s3 buckets dont behave like this.  it seems like it is there for security reasons?

    0
    Comment actions Permalink
  • Avatar
    Roee Ben Ari

    Indeed, trying to retrieve the newly renamed URL before the rename process is completed, will cache the 404 error as this article explains. Therefore, the best practice would be to wait until you get the response to the rename request and only then try and get the new URL. 
    Changing the transformation string, as 'differential enterprises' mentioned, will indeed work as it'll create a new derived version of the asset and hence bypass the cache, but it's not recommended as a permanent solution as it will increase the number of transformations you'll use (quota-wise). This method can be helpful in order to check if it's indeed a caching issue or something else. 

    0
    Comment actions Permalink

Please sign in to leave a comment.