Deployment Failed AEM cloud environment | Community
Skip to main content
Level 3
September 20, 2023

Deployment Failed AEM cloud environment

  • September 20, 2023
  • 2 replies
  • 1567 views

Hi Team, 

When I added the below Servlet class deployment failed in the AEM cloud environment , and in local its working fine

 

import java.io.IOException;

import java.io.PrintWriter;

import java.util.HashSet;

import java.util.Set;

 

import javax.jcr.Node;

import javax.servlet.Servlet;

 

import org.apache.sling.api.SlingHttpServletRequest;

import org.apache.sling.api.SlingHttpServletResponse;

import org.apache.sling.api.resource.Resource;

import org.apache.sling.api.resource.ResourceResolver;

import org.apache.sling.api.servlets.HttpConstants;

import org.apache.sling.api.servlets.SlingSafeMethodsServlet;

import org.apache.sling.commons.json.jcr.JsonItemWriter;

import org.osgi.framework.Constants;

import org.osgi.service.component.annotations.Component;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

 

@Component(service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=JSON renderer Servlet",

"sling.servlet.methods=" + HttpConstants.METHOD_GET, "sling.servlet.resourceTypes=" + "sling/servlet/default",

"sling.servlet.extensions=" + "json" })

public class GetPageJsonServlet extends SlingSafeMethodsServlet {

private static final Logger log = LoggerFactory.getLogger(GetPageJsonServlet.class);

private static final long serialVersionUID = 1L;

 

@SuppressWarnings("deprecation")

@Override

protected void doGet(final SlingHttpServletRequest req, final SlingHttpServletResponse resp) throws IOException {

try {

resp.setCharacterEncoding("UTF-8");

resp.setContentType("application/json");

final PrintWriter out = resp.getWriter();

final ResourceResolver resolver = req.getResourceResolver();

String path = "";

if (req.getPathInfo().contains("/us-en-header/")) {

path = "/content/experience-fragments/adobe/language-masters/en_us/navigation/us-en-header/master/jcr:content/root/header";

} else if (req.getPathInfo().contains("/us-en-footer/")) {

path = "/content/experience-fragments/adobe/language-masters/en_us/navigation/us-en-footer/master/jcr:content/root/footer";

}

Resource resource = resolver.getResource(path);

if(resource!=null) {

final Node node = resource.adaptTo(Node.class);

Set<String> propertiesToIgnore = new HashSet<>();

propertiesToIgnore.add("jcr:created");

propertiesToIgnore.add("jcr:createdBy");

propertiesToIgnore.add("sling:resourceType");

propertiesToIgnore.add("jcr:lastModifiedBy");

propertiesToIgnore.add("jcr:lastModified");

propertiesToIgnore.add("jcr:primaryType");

propertiesToIgnore.add("textIsRich");

JsonItemWriter jsonWriter = new JsonItemWriter(propertiesToIgnore);

jsonWriter.dump(node, out, -1, true);

resp.setStatus(SlingHttpServletResponse.SC_OK);

resp.setStatus(SlingHttpServletResponse.SC_INTERNAL_SERVER_ERROR);

}

} catch (Exception e) {

log.error("Error "+e);

}

}

}

Error Message 
skyline.job.internalState.reason=WaitingForAuthorComplete
12:42:43.769 [main] INFO com.adobe.granite.skyline.install.packages.queue.QueueHandler - Checking if queue for publish is blocked
12:42:44.534 [main] ERROR com.adobe.granite.skyline.install.packages.InstallPackages - Error in main thread
java.lang.NullPointerException: null
at com.adobe.granite.skyline.install.packages.queue.QueueHandler.getItemsList(QueueHandler.java:175)
at com.adobe.granite.skyline.install.packages.queue.QueueHandler.getQueueList(QueueHandler.java:157)
at com.adobe.granite.skyline.install.packages.queue.QueueHandler.getRemoveAbleQueues(QueueHandler.java:136)
at com.adobe.granite.skyline.install.packages.queue.QueueHandler.checkIfQueueIsBlocked(QueueHandler.java:67)
at com.adobe.granite.skyline.install.packages.InstallPackages.checkForBlockedQueues(InstallPackages.java:119)
at com.adobe.granite.skyline.install.packages.InstallPackages.install(InstallPackages.java:81)
at com.adobe.granite.skyline.install.packages.Main.call(Main.java:61)
at com.adobe.granite.skyline.install.packages.Main.call(Main.java:25)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at com.adobe.granite.skyline.install.packages.Main.main(Main.java:67)
12:42:44.535 [main] INFO com.adobe.granite.skyline.install.packages.KubernetesAnnotator - Setting kubernetes state Error
12:42:44.640 [main] INFO com.adobe.granite.skyline.install.packages.Kubernete

@2886983  @aanchal-sikka  @estebanbustamante  @mahedi_sabuj  @

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

aanchal-sikka
Community Advisor
Community Advisor
September 20, 2023

Hello @naruk89179065 

 

If I am not mistaken, the error doesn't convey any issue with your code

It has encountered an error while checking the status of publish queues. Please try following:

  • Go to Tools > Distribution
  • Check the replication queues, if any of them are blocked.
    • Is it a content?
    • Is it something deployed via code? 
  • If yes, please check why are they failing and resolve the issue
  • Delete the item from the queue thats blocking the queue
  • Deploy again.

 

There was also a recording shared few days ago regarding deployment failures. Please check if it helps

[Office Hours Recording] AEM as a Cloud Service D... - Adobe Experience League Community - 618653

Aanchal Sikka
Level 3
September 20, 2023

thanks @aanchal-sikka 

I verified and didn't find any replication queues block in the server, did a servlet modification sling. servlet.resourceTypes=" + "sling/servlet/default",  replaced by resource component path ,
Able to deploy code successfully in the server.

I am able to fetch data in my local instance,it's working fine 
When  tried dev server  its throwing below error
https://author-p66234-e6444773264.adobeaemcloud.com/content/abc/us/en/jcr:content.footer.json


20.09.2023 17:09:56.079 [cm-p66109-e603264-aem-author-6995849845-6852m] *INFO* [223.230.127.183 [1695229796078] GET /content/www/us/jcr:content.footer.json HTTP/1.1] com.webex.core.servlets.GetPageJsonServlet ::::::footer
20.09.2023 17:11:19.429 [cm-p66109-e603264-aem-author-6995849845-pxmk7] *WARN* [sling-oak-1-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-elastic-async] org.apache.jackrabbit.oak.composite.CompositeNodeStore Checkpoint r18ab39310ce-0-4 doesn't exist. Debug info:_Mount: [default]_Checkpoints:_ - r18ab3932408-0-4: {composite.checkpoint.expires=1781629879304, creator=AsyncIndexUpdate, composite.checkpoint.created=1695229879304, created=2023-09-20T17:11:19.304Z, name=elastic-async, thread=sling-oak-1-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-elastic-async}_ - r18ab3932401-1-4: {composite.checkpoint.expires=1781629879297, creator=AsyncIndexUpdate, composite.checkpoint.created=1695229879297, created=2023-09-20T17:11:19.297Z, name=async, thread=sling-oak-2-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-async}_ - r18ab3932401-0-4: {composite.checkpoint.expires=1781629879297, creator=AsyncIndexUpdate, composite.checkpoint.created=1695229879297, created=2023-09-20T17:11:19.297Z, name=fulltext-async, thread=sling-oak-5-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-fulltext-async}_ - r18ab39310de-0-4: {composite.checkpoint.expires=1781629874398, creator=AsyncIndexUpdate, composite.checkpoint.created=1695229874398, created=2023-09-20T17:11:14.398Z, name=async, thread=sling-oak-5-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-async}_/:async node: {fulltext-async = r18ab3932401-0-4, elastic-async = r18ab3932408-0-4, elastic-async-temp: [...], elastic-async-LastIndexedTo = 2023-09-20T17:11:19.304Z, fulltext-async-LastIndexedTo = 2023-09-20T17:11:19.297Z, async-temp: [...], fulltext-async-temp: [...], async = r18ab39310de-0-4, async-LastIndexedTo = 2023-09-20T17:11:14.398Z, async-lease = 1695231679315}_Mount: libs_Checkpoints:_ - 981bf269-f58a-4ea2-b300-49237936f777: {creator=AsyncIndexUpdate, created=2023-09-20T16:10:51.112Z, name=fulltext-async, thread=sling-oak-1-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-fulltext-async}_ - f01da450-7f91-4505-bed8-a95b4b53675f: {creator=AsyncIndexUpdate, created=2023-09-20T16:10:51.100Z, name=async, thread=sling-oak-3-org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate-async}_/:async node: {async-temp: [...], fulltext-async-temp: [...], fulltext-async-LastIndexedTo = 2023-09-20T16:10:51.112Z, async = f01da450-7f91-4505-bed8-a95b4b53675f, fulltext-async = 981bf269-f58a-4ea2-b300-49237936f777, async-LastIndexedTo = 2023-09-20T16:10:51.100Z}_
java.lang.Exception: null
at org.apache.jackrabbit.oak.composite.CompositeNodeStore.checkpointInfo(CompositeNodeStore.java:248) [org.apache.jackrabbit.oak-store-composite:1.52.0.T20230629133256-25c01b8]
at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.cleanUpCheckpoints(AsyncIndexUpdate.java:758) [org.apache.jackrabbit.oak-core:1.52.0.T20230629133256-25c01b8]
at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.maybeCleanUpCheckpoints(AsyncIndexUpdate.java:728) [org.apache.jackrabbit.oak-core:1.52.0.T20230629133256-25c01b8]
at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:629) [org.apache.jackrabbit.oak-core:1.52.0.T20230629133256-25c01b8]
at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:446) [org.apache.jackrabbit.oak-core:1.52.0.T20230629133256-25c01b8]
at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:349) [org.apache.sling.commons.scheduler:2.7.12]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [org.apache.sling.commons.scheduler:2.7.12]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Thanks
Kotireddy

Level 3
September 21, 2023

@naruk89179065 

 

The indexes seem to have issue. 

Please raise an Adobe ticket


thanks @aanchal-sikka 
 I wrote custom node iteration code ,then its working fine

Thanks
Kotireddy

kautuk_sahni
Community Manager
Community Manager
September 21, 2023

@naruk89179065 Did you find the suggestion from aanchal helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni