openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

UpstreamThumbnailException only raised when there are "ambiguous" problems and not for things outside the 2xx range

Open sarayourfriend opened this issue 3 years ago • 5 comments

Description

Requests does not raise an exception if a link 404s, you have to check the status code or call raise_for_status on the response.

Reproduction

  1. See the response from `https://api-dev.openverse.engineering/v1/images/aaabb3e4-cbd9-4a55-b16f-634fd9d91483/thumb/` which should be 424ing is instead 404ing (check the actual status code of the response, not the response contents which currently relays the upstream issue).

Additional context

Noticed while testing the v2.5.11 release but did not stop the release because we're still no longer 500'ing.

Resolution

  • [ ] 🙋 I would be interested in resolving this bug.

sarayourfriend avatar Aug 24 '22 18:08 sarayourfriend

I could work on this, but can one guide me how to do it?

MustkimKhatik avatar Sep 06 '22 02:09 MustkimKhatik

One more (slightly) related problem is that some items saved in the images table are actually audios (issue in the catalog: https://github.com/WordPress/openverse-catalog/issues/18). They return 406 errors when the front end requests a thumbnail.

obulat avatar Sep 06 '22 11:09 obulat

Hello @dhruvkb . I would like work on this issue. Please assign me this

sourav25998 avatar Sep 10 '22 11:09 sourav25998

Hey @sourav25998, thank you for you interest in resolving this but @MustkimKhatik has previosuoy expressed an intention to address this issue. Could you please pick a different one? Thanks!

dhruvkb avatar Sep 10 '22 11:09 dhruvkb

Hey @dhruvkb, we gotta change the landing URL as it broken for this but at the same time the error code should be 424 instead of 404. so can you please help me figuring out the current scenario here?

MustkimKhatik avatar Oct 02 '22 13:10 MustkimKhatik