Skip to content

QuickSight scheduled png snapshots not loading external CloudFront images

0

Hi, I've asked this question in the QuickSight community, but haven't had any luck with finding a solution, so I hope someone here might be able to assist. We’re experiencing weird behavior with images in scheduled email report snapshots from QuickSight. We are emailing a dashboard view, not a pixel perfect pdf. The view is a png wrapped as a PDF in the email, and we see the dashboard perfectly in the email this way, except images aren’t loading in time for the snapshot to be sent. When we open the dashboard in a browser and have half of it load, and resend the dashboard, the half that has loaded contains images.

Setup:

  • Dashboard with custom photos in a 4 tables (20 images total) displaying images via CloudFront URLs
  • Images display perfectly in interactive dashboard
  • Scheduled daily email reports (PDF format containing PNG snapshots)

Issue:

  • First snapshot of the day: Usually contains 0 images, today contained 1 image
  • After manually viewing dashboard in browser: Next email snapshot contains all images that loaded in the browser session
  • Snapshot history in QuickSight console confirms this pattern

Technical Details:

  • Using direct SQL query CONCAT('https://cloudfront-domain/ ', image_id) in dataset
  • CloudFront distribution is publicly accessible
  • Images are served dynamically via Lambda@Edge content negotiation based on Accept headers, the default is WebP

Any insights into how QuickSight handles external images during snapshot generation and how we can fix this would be greatly appreciated. If anyone knows a way to increase the job time so that the dashboard has more time to load before the snapshot is taken, that could be a possible solution too?

Since this is a POC we do not wish to use paginated reports yet. We only want to include the sheet in the email body.

Thanks in advance.

1 Answer
0

This issue appears to be related to how QuickSight loads external images when generating snapshots for scheduled email reports. Based on your description, the images aren't loading in time for the snapshot to be captured, but they do appear after you've manually viewed the dashboard in a browser.

Here are some potential solutions to address this issue:

  1. Network and access configuration: Ensure that QuickSight has proper access to your CloudFront distribution. Check that your network's firewall settings permit traffic from *.aws.amazon.com, amazonaws.com, wss://*.aws.amazon.com, and cloudfront.net. If you're using a proxy server, verify that *.quicksight.aws.amazon.com and cloudfront.net are added to your approved domains list.

  2. CloudFront caching optimization: Your issue might be related to CloudFront caching behavior. Consider:

  • Reviewing your cache policy settings and potentially creating a custom policy if the managed policy doesn't meet your needs
  • Adjusting Time to Live (TTL) settings to keep objects in the cache longer
  • Ensuring your origin server is setting appropriate caching headers
  • Checking compression settings in your cache policy
  1. Image delivery format: Since you mentioned your CloudFront setup uses Lambda@Edge with content negotiation based on Accept headers (defaulting to WebP), verify that QuickSight can properly handle this format. Consider modifying your Lambda@Edge function to serve JPG or PNG formats to QuickSight requests specifically.

  2. Alternative approach: Instead of using CloudFront URLs directly, you could consider using image components in QuickSight. Each analysis sheet supports up to 10 image components (not counting toward the 50 visual per sheet limit), with file size limits of 1MB per image. Supported formats include .bmp, .jpg/.jpeg, .png, .tiff, and .webp.

  3. S3 and CloudFront integration: If your images are stored in a private S3 bucket, you can use CloudFront to serve these images to QuickSight by creating a CloudFront distribution with the appropriate origin domain name and access control settings.

The fact that images appear after manually viewing the dashboard suggests that the caching mechanism is working, but the initial snapshot generation doesn't wait long enough for all resources to load. Unfortunately, there isn't a direct setting to increase the job time for snapshot generation in QuickSight.
Sources
I can't see my visuals - Amazon QuickSight
Cloudfront caching issue | AWS re:Post
Caching web page images when origin is set to alb for Cloudfront | AWS re:Post
Use images from a private Amazon S3 buckets on a Quicksight Dashboard | AWS re:Post
Using image components - Amazon QuickSight

answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.