Google Slides API: Intermittent "There was a problem retrieving the image." error from CreateImage request

736 Views Asked by At

I have a system (written in AWS Lambda) that generates Google Slides presentations. Various slides have images that come from our publicly-accessible AWS Cloudfront CDN. When it is going to make a CreateImageRequest, it first hits the URL with axios.js to confirm it exists, then adds the request to the payload.

The Google Slides API is now randomly reporting:

Invalid requests[n].createImage: There was a problem retrieving the image. The provided image should be publicly accessible, within size limit, and in supported formats.

Where n in requests[n] is any number. In other words, it doesn't matter which slide in the deck, or which image on the slide. It's always an image from this CDN. There also doesn't seem to be a pattern with the image that fails; other than one or two repeats, every image that fails I've seen is a different image in the same CDN. And, of course, the API will sometimes return without any issues on these same objects.

It happens very intermittently, and it seems more likely to happen the more people hitting this slide generation endpoint at once. It almost feels like some kind of rate limiting thing, but I pulled Cloudfront logs and all of these requests are 200s going to a client with a UserAgent Mozilla/5.0%20(compatible;%20GoogleDocs;%20apps-presentations;%20+http://docs.google.com).

Any thoughts?

Edit:

Google got back to me after I went into GCP to ask for quota increases. They said there is some undocumented internal image request limit and recommended doing the createImage requests grouped in separate batchUpdate requests spaced. 5s out or so.

0

There are 0 best solutions below