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
  • Did you try to use HTTP sniffers like IEInspector HTTPAnalyzer ot WireShark to see details of the MT Enhanced plugin communication from Studio?
    That should give you a hint how is it supposed to work.

    EDIT: Looking at the error message you posted I see that the hostname is missing completely (between the three slashes and the question mark). So that's probably your missing piece?

  • 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.
Reply
  • 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.
Children
No Data