0

While using Google Slides API request for batchUpdate request (ref: https://developers.google.com/slides/reference/rest/v1/presentations/request#createimagerequest), even when all images are valid, the library still throws this error, and it has been quite difficult to debug what exactly went wrong. I ensured image to be valid and matched requirements through Google API specs.

If there are better ways to catch specific details, please mention.

Error: Invalid requests[224].updatePageProperties: There was a problem retrieving the specified image.
    at Request.DefaultTransporter.wrapCallback_ [as _callback] (/path/to/project/node_modules/google-auth-library/lib/transporters.js:85:15)
    at Request.init.self.callback (/path/to/project/node_modules/request/request.js:186:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.readResponseBody (/path/to/project/node_modules/request/request.js:1081:10)
    at Request.EventEmitter.emit (events.js:95:17)
    at IncomingMessage.Request.onRequestResponse (/path/to/project/node_modules/request/request.js:1001:12)
    at IncomingMessage.g (events.js:180:16)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

And error object looks like:

 {
  "cause": {
    "code": 400,
    "errors": [
      {
        "message": "Invalid requests[224].updatePageProperties: There was a problem retrieving the specified image.",
        "domain": "global",
        "reason": "badRequest"
      }
    ]
  },
  "isOperational": true,
  "code": 400,
  "errors": [
    {
      "message": "Invalid requests[224].updatePageProperties: There was a problem retrieving the specified image.",
      "domain": "global",
      "reason": "badRequest"
    }
  ]
} 
Shobhit Sharma
  • 604
  • 1
  • 9
  • 18
  • 1
    that error normally indicates Slides couldn't download the image. to double check, can you download the image via public internet from a new incognito window? – Maurice Codik Jan 03 '17 at 21:29
  • @MauriceCodik Yes, I've tried to check all images in the batch queue, and all seems to be valid and <25 mp and <50MB. I also tried to download the images to a temporary directory, which results in similar exception. The issue it, it prevents whole presentation to be abort, just because of one image. – Shobhit Sharma Jan 04 '17 at 09:25
  • 1
    how many requests are you sending in the batch update request, and how many of those are adding images? you're right that just one image failing to load will fail the whole batch. I wonder if you might see a lower failure rate with smaller batches w/ retries. – Maurice Codik Jan 05 '17 at 15:11

0 Answers0