Expand my Community achievements bar.

SOLVED

AEM as a Cloud Service - createAsset: asset error while creating asset (only in publisher)

Avatar

Level 2

Hi everyone,

 

I am using AEMaaCS, I created a servlet to receive POST calls with multipart-form to upload assets through REST API:

 

@Component(service = Servlet.class,
property = {
ServletResolverConstants.SLING_SERVLET_METHODS + QueryConstants.EQUAL_SYMBOL
+ HttpConstants.METHOD_POST,
ServletResolverConstants.SLING_SERVLET_PATHS + QueryConstants.EQUAL_SYMBOL
+ "/apps/uploadAssetForApproval",
"sling.auth.requirements"+ QueryConstants.EQUAL_SYMBOL
+ "-/apps/uploadAssetForApproval"})
@ServiceDescription("Asset Upload Form servlet")
public class AssetUploadFormServlet extends SlingAllMethodsServlet

Once submitted, the file will be stored in a customized DAM folder, the folder will be dynamically created by AssetManager, the code I am using is:

 

private String createAsset(ResourceResolver resourceResolver, InputStream is, String path, String fileName, String fileType) {
try {
Session session = resourceResolver.adaptTo(Session.class);
com.day.cq.dam.api.AssetManager assetManager = resourceResolver.adaptTo(com.day.cq.dam.api.AssetManager.class);
String newFile = path + fileName;
if (assetManager != null) {
assetManager.createAsset(newFile, is, fileType, true);
session.save();
}
replicator.replicate(session, ReplicationActionType.ACTIVATE, newFile);
return newFile;
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
}
return null;
}

The path is generated with some variables in the submit form with a timestamp.

 

However, although the API works well in the author instance when testing, it doesn't work in the publisher.

 

The error:

 

27.02.2024 16:01:34.603 [cm-p33398-e120038-aem-publish-78bb48c65d-bftpz] *ERROR* [121.11.206.10 [1709049694540] POST /apps/uploadAssetForApproval HTTP/1.1] com.day.cq.dam.api.AssetManager createAsset: asset error while creating asset [/content/dam/dsms-assets/uploaded/TEMPORARY/Department 1/20240227_160134_545/738febb4f6a8810fb7248056012563fb.png]:
com.adobe.granite.asset.api.AssetException: Failed to create Asset at path [/content/dam/dsms-assets/uploaded/TEMPORARY/Department 1/20240227_160134_545/738febb4f6a8810fb7248056012563fb.png]
at com.adobe.granite.asset.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:78) [com.adobe.granite.asset.core:2.2.76]
at com.day.cq.dam.core.impl.AssetManagerImpl.createOrUpdateAsset(AssetManagerImpl.java:316) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.AssetManagerImpl.createOrUpdateAsset(AssetManagerImpl.java:260) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:247) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.hongkongbaptistuniversity.core.servlets.AssetUploadFormServlet.createAsset(AssetUploadFormServlet.java:225) [aem-hongkongbaptistuniversity-project.core:2024.227.1144835.0003795597]
at com.hongkongbaptistuniversity.core.servlets.AssetUploadFormServlet.doPost(AssetUploadFormServlet.java:106) [aem-hongkongbaptistuniversity-project.core:2024.227.1144835.0003795597]
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:146) [org.apache.sling.api:2.27.2]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342) [org.apache.sling.api:2.27.2]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374) [org.apache.sling.api:2.27.2]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:545) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:88) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.cq.dam.cfm.ui.impl.EditorCacheFilter.doFilter(EditorCacheFilter.java:102) [com.adobe.dam.cq-dam-cfm-impl:0.12.340]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.metrics.knownerrors.impl.ErrorLoggingComponentFilter.doFilter(ErrorLoggingComponentFilter.java:71) [com.adobe.granite.metrics.knownerrors:0.0.24]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:375) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.13.52]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:367) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:88) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:516) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:141) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:122) [com.adobe.granite.requests.logging:1.0.22]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70) [com.adobe.granite.rest.api:1.1.42]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96) [com.adobe.granite.rest.assets:1.0.74]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:385) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248) [com.day.cq.wcm.cq-wcm-mobile-core:5.11.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.hongkongbaptistuniversity.core.filters.LoggingFilter.doFilter(LoggingFilter.java:58) [aem-hongkongbaptistuniversity-project.core:2024.227.1144835.0003795597]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.servlet.DisableLegacyServletFilter.executeFilter(DisableLegacyServletFilter.java:197) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.servlet.DisableLegacyServletFilter.doFilter(DisableLegacyServletFilter.java:154) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:109) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76) [com.adobe.granite.optout:1.0.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:123) [com.adobe.cq.core.wcm.components.core:2.23.4]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:87) [org.apache.sling.rewriter:1.3.6]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81) [com.adobe.granite.httpcache.core:1.0.8]
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60) [com.adobe.granite.httpcache.core:1.0.8]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131) [org.apache.sling.i18n:2.6.2]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:225) [com.adobe.granite.csrf:1.0.26]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:162) [org.apache.sling.security:1.2.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:79) [com.adobe.granite.resourceresolverhelper:1.0.6]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:240) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:130) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:127) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.metrics.redimpl.REDMetricsServletFilter.doFilter(REDMetricsServletFilter.java:214) [com.adobe.granite.metrics.red:1.2.0]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.metrics.knownerrors.impl.ReportingRequestFilter.doFilter(ReportingRequestFilter.java:100) [com.adobe.granite.metrics.knownerrors:0.0.24]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.cors.impl.CORSFilter.doFilter(CORSFilter.java:94) [com.adobe.granite.cors:1.0.22]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.license.impl.http.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:301) [com.adobe.granite.license.http:1.0.0]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131) [org.apache.sling.i18n:2.6.2]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116) [org.apache.sling.featureflags:1.2.2]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:73) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigurer.java:67) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:152) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1000) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.ratelimit.AdaptiveRateLimitFilter.handleRequest(AdaptiveRateLimitFilter.java:323) [com.adobe.granite.ratelimit:4.0.2]
at com.adobe.granite.ratelimit.AdaptiveRateLimitFilter.doFilter(AdaptiveRateLimitFilter.java:290) [com.adobe.granite.ratelimit:4.0.2]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.auth.oauth.impl.OAuthCallbackFilter.doFilter(OAuthCallbackFilter.java:78) [com.adobe.granite.auth.oauth:1.10.18]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.auth.ims.impl.IMSClusterExchangeTokenPreprocessor.doFilter(IMSClusterExchangeTokenPreprocessor.java:241) [com.adobe.granite.auth.ims:1.4.38]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.cors.impl.CORSFilter.doFilter(CORSFilter.java:94) [com.adobe.granite.cors:1.0.22]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:345) [org.apache.sling.security:1.2.0]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:97) [org.apache.felix.http.sslfilter:1.2.6]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.log.RequestLoggerPreprocessor.doFilter(RequestLoggerPreprocessor.java:47) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.probes.impl.ProbesPreprocessor.doFilter(ProbesPreprocessor.java:54) [com.adobe.granite.probes:1.0.16]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1010) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:94) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49) [org.apache.felix.http.jetty:4.2.20]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [org.apache.felix.http.servlet-api:1.2.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:181) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.Server.handle(Server.java:516) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [org.apache.felix.http.jetty:4.2.20]
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.jcr.PathNotFoundException: 20240227_160134_545
at org.apache.jackrabbit.oak.jcr.session.NodeImpl$7.perform(NodeImpl.java:567) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl$7.perform(NodeImpl.java:561) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:229) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:113) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.getNode(NodeImpl.java:561) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1609) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1471) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1372) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at com.adobe.granite.asset.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:63) [com.adobe.granite.asset.core:2.2.76]
... 168 common frames omitted
27.02.2024 16:01:34.604 [cm-p33398-e120038-aem-publish-78bb48c65d-bftpz] *INFO* [121.11.206.10 [1709049694540] POST /apps/uploadAssetForApproval HTTP/1.1] com.day.cq.replication.impl.ReplicatorImpl Replication triggered, but no agent found or selected.

 

I've tried to:

1. Add permission to the system user I am using, add jcr:all to the DAM folder /content/dam/dsms-assets

2. Publish the target folder /content/dam/dsms-assets

 

But both didn't work. The error message is the same.

 

My question is:

1. Can AssetManager write files into the publisher instance?

2. If can, how can I solve the issue?

3. If cannot, is there any way to call through the publisher API but write files into the author instance?

 

Thanks guys in advance!

 

Update:

I tried to remove the timestamp design for the folder name, but get the error below:

28.02.2024 07:41:14.235 [cm-p33398-e120038-aem-publish-fb954f68f-vv8bp] *ERROR* [121.11.206.10 [1709106074133] POST /apps/uploadAssetForApproval HTTP/1.1] com.day.cq.dam.api.AssetManager createAsset: asset error while creating asset [/content/dam/dsms-assets/uploaded/TEMPORARY/Department 1/738febb4f6a8810fb7248056012563fb.png]:
com.adobe.granite.asset.api.AssetException: Failed to create Asset at path [/content/dam/dsms-assets/uploaded/TEMPORARY/Department 1/738febb4f6a8810fb7248056012563fb.png]
at com.adobe.granite.asset.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:78) [com.adobe.granite.asset.core:2.2.76]
at com.day.cq.dam.core.impl.AssetManagerImpl.createOrUpdateAsset(AssetManagerImpl.java:316) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.AssetManagerImpl.createOrUpdateAsset(AssetManagerImpl.java:260) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:247) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.hongkongbaptistuniversity.core.servlets.AssetUploadFormServlet.createAsset(AssetUploadFormServlet.java:225) [aem-hongkongbaptistuniversity-project.core:2024.228.164006.0003798502]
at com.hongkongbaptistuniversity.core.servlets.AssetUploadFormServlet.doPost(AssetUploadFormServlet.java:106) [aem-hongkongbaptistuniversity-project.core:2024.228.164006.0003798502]
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:146) [org.apache.sling.api:2.27.2]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:342) [org.apache.sling.api:2.27.2]
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:374) [org.apache.sling.api:2.27.2]
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:545) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:88) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.cq.dam.cfm.ui.impl.EditorCacheFilter.doFilter(EditorCacheFilter.java:102) [com.adobe.dam.cq-dam-cfm-impl:0.12.340]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.metrics.knownerrors.impl.ErrorLoggingComponentFilter.doFilter(ErrorLoggingComponentFilter.java:71) [com.adobe.granite.metrics.knownerrors:0.0.24]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:375) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94) [com.day.cq.cq-personalization:5.13.52]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:367) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:88) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:516) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:141) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:122) [com.adobe.granite.requests.logging:1.0.22]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70) [com.adobe.granite.rest.api:1.1.42]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96) [com.adobe.granite.rest.assets:1.0.74]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:385) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248) [com.day.cq.wcm.cq-wcm-mobile-core:5.11.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.hongkongbaptistuniversity.core.filters.LoggingFilter.doFilter(LoggingFilter.java:58) [aem-hongkongbaptistuniversity-project.core:2024.228.164006.0003798502]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.dam.core.impl.servlet.DisableLegacyServletFilter.executeFilter(DisableLegacyServletFilter.java:197) [com.day.cq.dam.cq-dam-core:5.15.58]
at com.day.cq.dam.core.impl.servlet.DisableLegacyServletFilter.doFilter(DisableLegacyServletFilter.java:154) [com.day.cq.dam.cq-dam-core:5.15.58]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:109) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76) [com.adobe.granite.optout:1.0.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226) [com.day.cq.wcm.cq-wcm-foundation:5.14.36]
at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:123) [com.adobe.cq.core.wcm.components.core:2.23.4]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90) [com.day.cq.wcm.cq-wcm-core:5.14.126]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:87) [org.apache.sling.rewriter:1.3.6]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81) [com.adobe.granite.httpcache.core:1.0.8]
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60) [com.adobe.granite.httpcache.core:1.0.8]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131) [org.apache.sling.i18n:2.6.2]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:225) [com.adobe.granite.csrf:1.0.26]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:162) [org.apache.sling.security:1.2.0]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:79) [com.adobe.granite.resourceresolverhelper:1.0.6]
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:240) [org.apache.sling.engine:2.15.10]
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:130) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:127) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.metrics.redimpl.REDMetricsServletFilter.doFilter(REDMetricsServletFilter.java:214) [com.adobe.granite.metrics.red:1.2.0]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.metrics.knownerrors.impl.ReportingRequestFilter.doFilter(ReportingRequestFilter.java:100) [com.adobe.granite.metrics.knownerrors:0.0.24]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.cors.impl.CORSFilter.doFilter(CORSFilter.java:94) [com.adobe.granite.cors:1.0.22]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.license.impl.http.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:301) [com.adobe.granite.license.http:1.0.0]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131) [org.apache.sling.i18n:2.6.2]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116) [org.apache.sling.featureflags:1.2.2]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:73) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigurer.java:67) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:149) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:152) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1000) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.ratelimit.AdaptiveRateLimitFilter.handleRequest(AdaptiveRateLimitFilter.java:323) [com.adobe.granite.ratelimit:4.0.2]
at com.adobe.granite.ratelimit.AdaptiveRateLimitFilter.doFilter(AdaptiveRateLimitFilter.java:290) [com.adobe.granite.ratelimit:4.0.2]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.auth.oauth.impl.OAuthCallbackFilter.doFilter(OAuthCallbackFilter.java:78) [com.adobe.granite.auth.oauth:1.10.18]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.auth.ims.impl.IMSClusterExchangeTokenPreprocessor.doFilter(IMSClusterExchangeTokenPreprocessor.java:241) [com.adobe.granite.auth.ims:1.4.38]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.cors.impl.CORSFilter.doFilter(CORSFilter.java:94) [com.adobe.granite.cors:1.0.22]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:345) [org.apache.sling.security:1.2.0]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:97) [org.apache.felix.http.sslfilter:1.2.6]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.sling.engine.impl.log.RequestLoggerPreprocessor.doFilter(RequestLoggerPreprocessor.java:47) [org.apache.sling.engine:2.15.10]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at com.adobe.granite.probes.impl.ProbesPreprocessor.doFilter(ProbesPreprocessor.java:54) [com.adobe.granite.probes:1.0.16]
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:137) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1006) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1010) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:94) [org.apache.felix.http.jetty:4.2.20]
at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49) [org.apache.felix.http.jetty:4.2.20]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [org.apache.felix.http.servlet-api:1.2.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:181) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.Server.handle(Server.java:516) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [org.apache.felix.http.jetty:4.2.20]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [org.apache.felix.http.jetty:4.2.20]
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.jcr.AccessDeniedException: Access denied.
at org.apache.jackrabbit.oak.jcr.security.AccessManager.checkPermissions(AccessManager.java:71) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(NodeImpl.java:320) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl$5.perform(NodeImpl.java:289) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:229) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:113) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.addNode(NodeImpl.java:289) [org.apache.jackrabbit.oak-jcr:1.58.0.T20231123092841-619e1bd]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1617) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1471) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at org.apache.jackrabbit.commons.JcrUtils.getOrCreateByPath(JcrUtils.java:1372) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.20.13]
at com.adobe.granite.asset.core.impl.AssetManagerImpl.createAsset(AssetManagerImpl.java:63) [com.adobe.granite.asset.core:2.2.76]
... 168 common frames omitted

Looks like a permission issue, but I have added jcr:all to the DAM folder and activated the system user, what else can I do?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

 

Firstly, you should not use this approach. It is not advisable to upload assets to a publish instance, and even worse, to open this URL publicly, as it could pose a significant security breach.

Secondly, you should avoid using the Assets API to upload assets, as it is deprecated. Instead, you should utilize the aem-upload feature.

 

Finally, the issue you are encountering points out two things:

  1. The path where you are attempting to upload the asset is invalid. Most likely, you are using an incorrect one. Please refer to the official documentation to validate the parameters you are passing to the method: https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/dam/api/As... 
javax.jcr.PathNotFoundException: 20240227_160134_545

 

2.The resource resolver you are using does not have the proper permissions. Make sure to obtain the necessary permissions by initiating a new session using a system user with the appropriate access https://www.theaemmaven.com/post/system-users-in-aem-6-5-and-aemaacs 

Caused by: javax.jcr.AccessDeniedException: Access denied.

 

 Hope this helps.



Esteban Bustamante

View solution in original post

2 Replies

Avatar

Level 1

@HenryLiang Please check the below link for what API is supported in AEMaCS

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/admin/develo...

 

SaravananDharmaraj_0-1709137953985.png

Adobe suggest not to use API in second column to create asset with "x" , basically using assetManager API

 

Also check this one too if you still want to proceed and make sure the servlet is running with session which has write access to the folder.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-assets/correct-api-to-crea... 

Avatar

Correct answer by
Community Advisor

Hi, 

 

Firstly, you should not use this approach. It is not advisable to upload assets to a publish instance, and even worse, to open this URL publicly, as it could pose a significant security breach.

Secondly, you should avoid using the Assets API to upload assets, as it is deprecated. Instead, you should utilize the aem-upload feature.

 

Finally, the issue you are encountering points out two things:

  1. The path where you are attempting to upload the asset is invalid. Most likely, you are using an incorrect one. Please refer to the official documentation to validate the parameters you are passing to the method: https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/dam/api/As... 
javax.jcr.PathNotFoundException: 20240227_160134_545

 

2.The resource resolver you are using does not have the proper permissions. Make sure to obtain the necessary permissions by initiating a new session using a system user with the appropriate access https://www.theaemmaven.com/post/system-users-in-aem-6-5-and-aemaacs 

Caused by: javax.jcr.AccessDeniedException: Access denied.

 

 Hope this helps.



Esteban Bustamante