adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

Getting error on using the image on ootb components #2315

Open shajiahmed opened 1 year ago

shajiahmed commented 1 year ago

After dragging and dropping the image on image component, I am getting following error in logs. It works some times, failing 1 in 5 attempts Even this image works fine if I refresh the page, this issue happens only when I drag and drop image on image component or parsys. 19.09.2022 16:58:27.313 ERROR [[0:0:0:0:0:0:0:1] [1663621107290] GET /content/el-xxx/us/en/_jcr_content/root/container/container/image.coreimg.85.1600.jpeg/1663621106322/52370246583-71613e2d9e-m.jpeg HTTP/1.1] org.apache.sling.engine.impl.SlingMainServlet service: Uncaught Problem handling the request java.io.IOException: Cannot process rendition original due to size null at com.adobe.cq.wcm.core.components.internal.servlets.AdaptiveImageServlet.filter(AdaptiveImageServlet.java:643) [com.adobe.cq.core.wcm.components.core:2.19.0]

ky940819 commented 1 year ago

Hello,

A couple of follow up questions:

  1. When you go to the URL shown in the error log do you get a repeatable 500 error?
  2. When you refresh the page do you also load the 1600px wide version of the image? Check your network tab in the dev tools on page reload to see if the image has 85.1600 in the URL or something else.

Here's my (completely untested theory): The adaptive image servlet as determined that the best rendition to use for crafting the requested image is the original rendition (as it was uploaded to the DAM). Typically the rendition must be below some configuration size (set in OSGI config - default is 3840px). This is to prevent the servlet from becoming overwhelmed trying to resize a massive image.

However, based on your error it doesn't seem that the image failed because it was rejected for being too large; rather, it appears the image was rejected because it could not determine the size of the original image at all (i.e the [...]due to size null part of the error message).

So, in addition to what I asked above, could you also look at the original rendition for the image in the DAM and see if there's something off about that? Maybe the metadata wasn't written properly. Perhaps try re-uploading the original rendition - or just delete the image and re-upload the entire thing again from a known-good existing image.

Let me know if any of this is helpful (hopefully). Kyle

bpauli commented 1 year ago

@shajiahmed Can you please provide some more information regarding your environment. Which version of AEM and Core Components are you using? Thanks!

shajiahmed commented 1 year ago

Here is what I am trying. My AEM version is 6.5 with sp12. Core components version 2.19.0 My DAM assets are in external DAM provider, I have written custom js event drop listener which uploads the asset as soon as it is dropped on the image component. Asset is being loaded successfully to AEM DAM using servlet async ajax call . I do see the renditions being created successfully. However when the drop is finished, image doesn't render, it throws java.io.IOException: Cannot process rendition original due to size null. I checked original rendition size not null. When I refresh the page, image renders successfully. Most of the assets display fine as soon as it is dropped on the image component. However out of 5 drops, one drop is failing with that error, but renders fine when refreshed the page. I tried changing ajax from async to sync call, issue remains same.