Expand my Community achievements bar.

SOLVED

AEM 6.5.14 : Microsoft translator thowing error

Avatar

Level 3

All - We are trying to integrate Microsoft translator for translations. We have created a translator integration in our project conf folder with key from our azure translator service. Connection is successful for our integraion. When we are running a translation job we are getting below error:

com.adobe.granite.translation.api.TranslationException: Error Code: TRANSLATION_FAILED. Message: Error Code: TRANSLATION_FAILED. Message: Status code from HttpClient did not return 200. Status Code: 400 The URL we called was: https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&textType=HTML&to=es&......... and data was [{"text":"https://www.xyz.com/content/xyz/en_US/services/general/faqs/customer-info.html"},{"text":"Customer Information Help"},{"text":"some long text."},{"text":"Customer Information Help | FAQ"}]
at com.adobe.granite.translation.connector.msft.core.impl.MicrosoftTranslationServiceImpl.getTranslatedTextForArray(MicrosoftTranslationServiceImpl.java:549) [com.adobe.granite.translation.connector.msft.core:1.3.26]
at com.adobe.granite.translation.connector.msft.core.impl.MicrosoftTranslationServiceImpl.translateArray(MicrosoftTranslationServiceImpl.java:522) [com.adobe.granite.translation.connector.msft.core:1.3.26]
at com.adobe.cq.wcm.translation.impl.CQPageMachineTranslator.translatePropertyList(CQPageMachineTranslator.java:156) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.CQPageMachineTranslator.saveCacheQueue(CQPageMachineTranslator.java:138) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.CQPageMachineTranslator.translateResourceList(CQPageMachineTranslator.java:109) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.TranslationObjectImpl.startMachineTranslation(TranslationObjectImpl.java:629) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.TranslationObjectImpl.translateNow(TranslationObjectImpl.java:458) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.TranslationPodImpl.startTranslation(TranslationPodImpl.java:1253) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.TranslationPodImpl.syncTranslation(TranslationPodImpl.java:2478) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.process.SyncTranslationProcess.syncTranslationJob(SyncTranslationProcess.java:170) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.adobe.cq.wcm.translation.impl.process.SyncTranslationProcess.execute(SyncTranslationProcess.java:130) [com.day.cq.wcm.cq-wcm-translation:1.5.126]
at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93) [com.day.cq.workflow.cq-workflow-impl:6.3.8.CQ652-B0003]
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:194) [com.adobe.granite.workflow.core:2.0.240.CQ658-B0017]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:276) [com.adobe.granite.workflow.core:2.0.240.CQ658-B0017]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.24]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:351) [org.apache.sling.event:4.2.24]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.24]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:287) [org.apache.sling.event:4.2.24]
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)

 

While the same job translated using default Microsoft translator is translated fine. I fail to understand if the issue is in AEM configuration or Azure translator config. If anyone has faced this or similar issue before, please provide your inputs.

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @aem1234567 ,

 

From the stacktrace, looks like some issue with the request format which MS translator API is rejecting.

You could check if you are able to simulate a similar scenario with Postman (if that's possible).

 

Also, raise a support ticket to look into it from the AEM side.

 

Hope this helps!

 

Regards,

Nitesh

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi @aem1234567 ,

 

From the stacktrace, looks like some issue with the request format which MS translator API is rejecting.

You could check if you are able to simulate a similar scenario with Postman (if that's possible).

 

Also, raise a support ticket to look into it from the AEM side.

 

Hope this helps!

 

Regards,

Nitesh

Avatar

Level 1

Hi @aem1234567,

I am also facing the same issue. Please share the fix if this issue is resolved for you.

 

Thanks in advance!

Kanika