NextJs Image giving 502 bad getway

Am getting an 502 bad gateway for images in netlify which are coming from contenthub, but it worked fine in local.

Image url: https://assets.kerzner.com/api/public/content/34ee2af57fdb4b779ce60e95329bf8e7?v=70023764

next config: images: {
// unoptimized: true,
deviceSizes: [320, 420, 768, 991, 1024, 1200, 1500],
domains: [
eu-images.contentstack.com’, ‘images.contentstack.io’, ‘assets.kerzner.com
],
},

error: main-b9ef7ed951f075d6.js:1 GET https://test-aquaweb.netlify.app/_next/image?url=https%3A%2F%2Fassets.kerzn…lic%2Fcontent%2F51d2221…%3Fv%3Dbae6ce44&w=256&q=75 502 (Bad Gateway)

(anonymous) @ main-b9ef7ed951f075d6.js:1
r @ main-b9ef7ed951f075d6.js:1
(anonymous) @ main-b9ef7ed951f075d6.js:1
updateHead @ main-b9ef7ed951f075d6.js:1
i @ main-b9ef7ed951f075d6.js:1
(anonymous) @ main-b9ef7ed951f075d6.js:1
uI @ framework-0995a3e8436ddc4f.js:9
oU @ framework-0995a3e8436ddc4f.js:9
(anonymous) @ framework-0995a3e8436ddc4f.js:9
oI @ framework-0995a3e8436ddc4f.js:9
oC @ framework-0995a3e8436ddc4f.js:9
r8 @ framework-0995a3e8436ddc4f.js:9
(anonymous) @ framework-0995a3e8436ddc4f.js:9

@Varun_Gowda You seem to have demonstrated three different URL’s in your post.

The first one ends in:

f8e7

The second one is truncated with ... and ends in:

ce44

The one in your screenshot ends in:

fdb4

Can you provide at least one, non truncated URL for an image that fails to load (and where it doesn’t need to be retyped from a screenshot)?

Hi @nathanmartin,
please check below url without any trucat.

Image url: https://assets.kerzner.com/api/public/content/34ee2af57fdb4b779ce60e95329bf8e7?v=70023764

@Varun_Gowda Check your Function Logs:
https://docs.netlify.com/functions/logs/

I’m not sure what the issue is, but the function appears to work until it has all required parameters.
My guess is that the function logs will shed some light on why it’s failing.

This asks for the q parameter:
https://test-aquaweb.netlify.app/_next/image?url=https%3A%2F%2Fassets.kerzner.com%2Fapi%2Fpublic%2Fcontent%2F34ee2af57fdb4b779ce60e95329bf8e7&w=200

This fails:
https://test-aquaweb.netlify.app/_next/image?url=https%3A%2F%2Fassets.kerzner.com%2Fapi%2Fpublic%2Fcontent%2F34ee2af57fdb4b779ce60e95329bf8e7&w=200&q=100

When I try to visit the site to see failing images, I see a white page. Where can I see the images? The URLs shared here show a HTTP 400 and not a 502, so I want to be sure I’m checking the same thing.