openverse icon indicating copy to clipboard operation
openverse copied to clipboard

Europeana thumbnail request fails with 400 from API even though the upstream image accelerator returns a valid image when requested directly

Open krysal opened this issue 1 year ago • 10 comments

Description

There is a problem with a Europeana image in that the API fails to process the /thumb request even when Photon (the image accelerator 3rd party part) returns it correctly. Sentry shows a bad request as a hint of the problem.

ClientResponseError: Bad Request
  File "api/utils/image_proxy/__init__.py", line 177, in get
    upstream_response.raise_for_status()

Reproduction

  1. Go to https://api.openverse.engineering/v1/images/c17f7ec8-d8ae-4e83-9440-5d1c35fb5d0f/thumb/
  2. Observe the response is a 424 Failed Dependency
  3. Follow the Photon/Image accelerator link showed: https://i0.wp.com/imeji-mediathek.de/imeji/file/hFfmQSuYGYX2mJzI/92/07/d6/7a-35a9-4e68-a2f4-e1557938a545/0/original/9cda59f585ae70e2dc99d3f993197dbd.jpg?w=600&quality=80
  4. See it working, making the first result unexpected and wrong.

To fix this, we need to investigate why the upstream URL succeeds when directly requested but fails when requested from our API. In other words, why does our API get a 400 from Site Accelerator when we can get a successful response individually?

This is probably an infrastructure issue, either with our specific Site Accel. integration (which requires elevated access to secrets to fully test locally) or an issue with our networking infrastructure. The issue is staff only, as a result.

Additional context

Related to #3970.

krysal avatar Feb 10 '24 21:02 krysal