Skip to content

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

Open
@charlie-wan

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions