Sdl-Community icon indicating copy to clipboard operation
Sdl-Community copied to clipboard

Microsoft Translator Provider reports null error after certain period of no query

Open charlie-wan opened this issue 1 year ago • 0 comments

Environment: Trados Studio v2022 SP2, Microsoft Translator Provider v1.1.5.0

Symptom: According to my observation, the provider plugin reports the null reference error after 10 minutes if no translation query is made. If further query is made before the 10 minutes period concludes, the 10 minutes period will be interrupted and re-calculated. The error could be resolved by re-enabling the plugin.

Suspected cause: I suspected this relates to the authentication token of Azure API, which is valid for 10 minutes according to this page https://learn.microsoft.com/en-us/azure/ai-services/translator/reference/v3-0-reference.

Error logs: MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-02-22 14:20:42.3861 Error LogException Value cannot be null. Parameter name: input at System.Text.RegularExpressions.Regex.Matches(String input) at MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)
MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-02-22 14:20:42.3861 Error LogException Value cannot be null. Parameter name: input at System.Text.RegularExpressions.Regex.Matches(String input) at MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)
MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-02-22 14:20:42.3861 Error LogException Value cannot be null. Parameter name: input at System.Text.RegularExpressions.Regex.Matches(String input) at MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)
MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-02-22 14:20:42.3861 Error LogException Value cannot be null. Parameter name: input at System.Text.RegularExpressions.Regex.Matches(String input) at MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)
MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-02-22 14:20:42.3861 Error LogException Object reference not set to an instance of an object. at MicrosoftTranslatorProvider.Helpers.TagPlacer.GetTargetElements() at MicrosoftTranslatorProvider.Helpers.TagPlacer.TryGetTaggedSegment(String returnedText) at MicrosoftTranslatorProvider.Helpers.TagPlacer.GetTaggedSegment(String returnedText)
MicrosoftTranslatorProvider.Helpers.ErrorHandler: 2024-02-22 14:20:44.0683 Error HandleError: System.NullReferenceException: Object reference not set to an instance of an object. at MicrosoftTranslatorProvider.Studio.TranslationProvider.MicrosoftApi.RequestTranslation(String sourceLanguage, String targetLanguage, String textToTranslate, String categoryID) at MicrosoftTranslatorProvider.Studio.TranslationProvider.MicrosoftApi.TryTranslate(String sourceLanguage, String targetLanguage, String textToTranslate, String categoryID) at MicrosoftTranslatorProvider.Studio.TranslationProvider.MicrosoftApi.Translate(LanguagePair languagepair, String textToTranslate)

charlie-wan avatar Feb 26 '24 01:02 charlie-wan