This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unexpected exception when initializing task, using server TMs on Groupshare 2017 server. failed to initialize translation engine follows.

Dear SDL Devs and Community,

we are using the API of the latest Trados Studio 2019 with server based TMs on a GS 17 server and keep running into the following problem.

We have an existing sdlproj project. This project was created based on a project template which had information on Server-TMs on our server URL (gs 2017 server) and uses TMs on this very server. The TMs are thus known by our created project.

We have several occurences in our code of similar error messages. The following stack of exception is produced when calling:

ProjectPackageCreation projectPackage = project.CreateProjectPackage(Guid manualTaskId, string packageName, string comment, ProjectPackageCreationOptions options);

What you will see next are the Exception and InnerExceptions of the ProjectPackageCreation object.

Unexpected exception when initializing task 'Analyse': Die Übersetzungs-Engine 'sdltm.URL/Organization English (US) - French (France)' konnte nicht instanziiert werden..

Sdl.ProjectAutomation.Core.ProjectAutomationException: Unexpected exception when initializing task 'Analyse': Die Übersetzungs-Engine 'sdltm.https://URL/?orgPath=%2FOrganization&tmName=Organization English (US) - French (France)' konnte nicht instanziiert werden.. ---> Sdl.ProjectApi.ProjectApiException: Unexpected exception when initializing task 'Analyse': Die Übersetzungs-Engine 'sdltm.https://URL/?orgPath=%2FOrganization&tmName=Organization English (US) - French (France)' konnte nicht instanziiert werden.. ---> Sdl.ProjectAutomation.Core.ProjectAutomationException: Die Übersetzungs-Engine 'sdltm.https://URL/?orgPath=%2FOrganization&tmName=Organization English (US) - French (France)' konnte nicht instanziiert werden. ---> System.Collections.Generic.KeyNotFoundException: No identity information found for server 'https://URL/'.
bei Sdl.Enterprise2.Studio.Platform.Client.IdentityModel.IdentityInfoCache.ValidateKey(String key)
bei Sdl.Enterprise2.Studio.Platform.Client.IdentityModel.IdentityInfoCache.GetIdentityInfo(String key)
bei Sdl.LanguagePlatform.TranslationMemoryApi.IdentityInfoCacheCredentialStore.GetCredential(Uri uri)
bei Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderCredentialStore.GetCredential(Uri uri)
bei Sdl.LanguagePlatform.TranslationMemoryApi.ServerBasedTranslationMemoryFactory.GetUserCredentials(Uri translationProviderUri, ITranslationProviderCredentialStore credentialStore)
bei Sdl.LanguagePlatform.TranslationMemoryApi.ServerBasedTranslationMemoryFactory.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)

In preparation of the project package creation step, we try to make sure, that the TMs are available to the project as follows:

string credentials = "user=" + tmServer.username + ";password=" + tmServer.password + ";type=CustomUser";
project.Credentials.AddCredential(strTmUri, credentials);
project.UpdateTranslationProviderConfiguration(tmConfig);
project.Save();

with strTmUri being similar to this: 'sdltm.URL/ English (US) - German (Germany)'

It seems to us, that somehow the login credentials, URL, TM name or a combination of these is wrong. Since we basically are using the demo code from several SDL sources (see links below) it would be great, if you could point out other potential sources of error.

Our project is huge, new, and does work as expected in general but does not really cooperate well with server based TMs on the GS server. We tried to apply everything the docu states @ http://producthelp.sdl.com/SDK/TranslationMemoryApi/2017/html/50a524b7-e3fe-4ba6-894b-b3959fd3f8ce.htm and of course in the projectautomation API part. Further clarification on your side would be greatly appreciated.

Best regards,

Hendrik, on behalf of the Plunet CAT integration team

We already used these resources describing similar problems and TM handling:

https://community.sdl.com/developers-more/developers/language-developers/f/api_qa_-_sdl_tms/12877/how-to-use-analyzefiles-pretranslate-tasks-with-server-based-translation-memory

https://community.sdl.com/developers-more/developers/language-developers/f/sdk_qa/1013/analyzefiles-and-pretranslatefilestasks-inproject-automation-api-ignore-server-tms

https://gist.github.com/cromica/e1a976fdfdc821136c7610b5e984904e

https://github.com/sdl/trados-studio-api-samples/tree/master/LanguagePlatform/Sdl.SDK.LanguagePlatform.Samples.TmAutomation

http://producthelp.sdl.com/SDK/TranslationMemoryApi/3.0/html/646950ef-d135-46dd-a2cf-1c4ebf57ec94.htm




[locked by: Paul at 7:24 AM (GMT 1) on 29 Apr 2021]
Parents
  • I am updating the question above with further logs extracted from the SDL API. We get similar but not the same Errors when trying to work with the server TM project after ~8 hours (the olde token not valid anymore bug?):

    1. Unexpected exception when configuring file multiFileConverter for task 'Dateien vorübersetzen': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
      We receive this message after running an AutomaticTaskTemplateIds.PreTranslateFiles as RunAutomaticTask on our project, which is referencing server TMs. After
      foreach (MessageEventArgs messageEvent in messageEventArgsList)
      we don't get any exception in
      messageEvent.Message.Exception
      , even if the message received obviously states "Unexpected exception"
    2. The same problem seems to occur after calling AutomaticTaskTemplateIds.AnalyzeFiles, also by using RunAutomaticTask on the project:
      Unexpected exception when initializing task 'Analyse': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
    3. The last one has a slightly different error messge, happening when using AutomaticTasks.TranslationCount:
      Unexpected exception when configuring file multiFileConverter for task 'Übersetzte Wörter zählen': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
Reply
  • I am updating the question above with further logs extracted from the SDL API. We get similar but not the same Errors when trying to work with the server TM project after ~8 hours (the olde token not valid anymore bug?):

    1. Unexpected exception when configuring file multiFileConverter for task 'Dateien vorübersetzen': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
      We receive this message after running an AutomaticTaskTemplateIds.PreTranslateFiles as RunAutomaticTask on our project, which is referencing server TMs. After
      foreach (MessageEventArgs messageEvent in messageEventArgsList)
      we don't get any exception in
      messageEvent.Message.Exception
      , even if the message received obviously states "Unexpected exception"
    2. The same problem seems to occur after calling AutomaticTaskTemplateIds.AnalyzeFiles, also by using RunAutomaticTask on the project:
      Unexpected exception when initializing task 'Analyse': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
    3. The last one has a slightly different error messge, happening when using AutomaticTasks.TranslationCount:
      Unexpected exception when configuring file multiFileConverter for task 'Übersetzte Wörter zählen': Die Übersetzungs-Engine 'sdltm.URL/ %28US%29 - French %28France%29' konnte nicht instanziiert werden..
Children
No Data