There is custom worklfow process step to send mail using Day CQ Mail Service configs. This is working fine in local AEM sdk setup. But we I deployed these changes to Cloud instance I am getting below error:
com.adobe.granite.workflow.core.job.JobHandler Error executing workflow step
com.adobe.granite.workflow.WorkflowException: Process execution resulted in an error
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:204) [com.adobe.granite.workflow.core:2.1.104]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:300) [com.adobe.granite.workflow.core:2.1.104]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.3.8]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:351) [org.apache.sling.event:4.3.8]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.3.8]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:287) [org.apache.sling.event:4.3.8]
Caused by: com.day.cq.mailer.MailingException: Invalid mail service configuration.
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:292) [com.day.cq.cq-mailer:5.4.22]
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:46) [com.day.cq.cq-mailer:5.4.22]
at com.hostplus.program.core.services.NotificationMailService.execute(NotificationMailService.java:125) [hostplus-program.core:1.0.0.SNAPSHOT]
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:198) [com.adobe.granite.workflow.core:2.1.104]
There is one solution to restart com.day.cq.cq-mailer bundle but we dont have access to system console on cloud instance. Anyone is
Can you please confirm if you have followed all the steps as described on https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/networking/examples/e...
Ensure the the appropriate advanced networking configuration has been set up
OSGi configuration using proxy
Thanks for your reply. I followed above link and setup Env variable in cloud manager. I have created OSGI config and provided env values as below:
Are you getting these errors on local or server?
conf = configAdmin.getConfiguration(pid);
Dictionary<String, Object> props = conf.getProperties();
String smtpUser = (String)props.get("smtp.user");Its reading values of smtp.user as
I guess you are using custom code for sending emails.
Can you possibly share snippet of your code?
Meanwhile, to check that your Proxy set-up and configs are correct, try sharing link of an Asset to you email ID:
- Select an asset
- Click Share Link
- Add details
- Check if you receive email
Yes I have created custom workflow process step to send email notification for approval when user starts workflow. Below is the snippet:
Yes I tried sharing assets as mentioned but Share Link is not correct one. I have deployed mail send functionality code on one of the test instance and there I am trying to share asset link but I see that share link is showing dev instance URL not test instance and I think thats why am getting error: Email service not available, cannot send asset share email.
Email service code is only available on test instance.
Adding with @aanchal-sikka, can you check the following
- access to the server using SSH
- then try to connect to the smtp server using telnet on the expected port
telnet smtp.example.com 25
- If you can not connect, you might need to explicitly open the port(s) for any IP (outbound request) on the load balancer. You can raise support ticket for that
@supriya-hande Did you find the suggestions from users 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.