Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'mtenhanceprovider'

Please forgive me if anything is unclear, I'm new to SDL so I will try to clarify if anything is unclear.

I am creating an external application that can create a new Project, add files from a local directory, attach a TM, and fall back on the MT Enhance using Microsoft Translator. I've set up a Project Template, which uses the TM and the Automated Translation. Both working properly within the Studio application (with and without a category ID). However, when I use it through my application, it always fails at the Analyze Files task with this error:

{"Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'mtenhancedprovider:///?sendplaintextonly=False&selectedprovider=Microsoft+Translator&usecatid=False&catid=65c5ca74-d991-4f3f-9374-224861807990-en-US-es-MX-TMX-CUSTOM&resenddrafts=False&usepreedit=False&usepostedit=False&prelookupfilename=&postlookupfilename='.."}

I think I need to add something within the AnalysisTaskSettings but I'm not sure what or how. I tried adding credentials using the 'mtenahncedprovider:///' as the Uri and the API key as the credentials but I'm guessing that is incorrect. Any help would be greatly appreciated.

Parents Reply Children
  • Thanks for the quick reply!

    I'll take a look at the HTTP sniffer and see if that helps. Did not even click in my mind that the hostname was missing.That actually has me thinking I'm not properly associated the MT Enhanced plugin prior to running the Analyze.
  • Since I was using a template, I wanted to see if the MT Enhanced was being picked up by the GetTranslationProviderConfiguration method and it was. As a test, I removed the MT Enhanced from the template, and instead added it from my application prior to running the Task. This time I got this message:

    "Unexpected exception when configuring file multiFileConverter for task 'Analyze Files': Authentication failed for translation provider 'mtenhancedprovider:///'.."

    I used WireShark and saw when run through Studio, it was accessing api.cognitive.microsoft.com. This led me to some documentation from Microsoft.

    I then attempted to add this to the Uri and am now receiving this (note I added a "Pre-translate Files" task in front of the Analyze):

    "Unexpected exception when configuring file multiFileConverter for task 'Pre-translate Files': Failed to create an instance of translation provider 'api.cognitive.microsofttranslator.com/translate

    I'm not as familiar with Wire Shark as I wish so I'm not sure how to dig further there, but I think I'm heading in the right direction as I'm not getting the authentication error now.