API: Failed to create an instance of translation provider deepltranslationprovider

I am currently using v4.8.25 of the plug-in, and I am still having issues when executing the Analyze and Pre-translate tasks from the API whenever my project template includes a Deepl MT provider. Could you please confirm from which version are this issues fixed?

For Analyze I have the same exception as Tamas above:

Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider 'deepltranslationprovider:///?formality=Default&sendPlain=False'..

For Pre-translate I have the exception:

Unexpected exception when configuring file multiFileConverter for task 'Pre-translate Files': Failed to create an instance of translation provider 'deepltranslationprovider:///?formality=Default&sendPlain=False'..

My issue seems related to community.rws.com/.../deepl-plugin-crash-when-running-automatic-tasks-programatically

Thank you very much for your valuable support.

Kind regards,

Alejandroi

Parents
  • Stack trace using NLog 4.0.0.0 (my Studio 15 folder has v4.3.2894 installed)

    ProjectFileId :
    Source        : AutomaticTaskExecuter
    Message       : Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider
                    'deepltranslationprovider:///?formality=Default&sendPlain=False'..
    Level         : Error
    Exception     : Sdl.ProjectAutomation.Core.ProjectAutomationException: Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider
                    'deepltranslationprovider:///?formality=Default&sendPlain=False'.. ---> Sdl.ProjectApi.ProjectApiException: Unexpected exception when initializing task 'Analyze Files':
                    Failed to create an instance of translation provider 'deepltranslationprovider:///?formality=Default&sendPlain=False'.. --->
                    Sdl.ProjectAutomation.Core.ProjectAutomationException: Failed to create an instance of translation provider
                    'deepltranslationprovider:///?formality=Default&sendPlain=False'. ---> System.TypeInitializationException: The type initializer for
                    'Sdl.Community.DeepLMTProvider.Studio.DeepLTranslationProviderConnecter' threw an exception. ---> System.MissingMethodException: Method not found: 'Void
                    NLog.Config.LoggingConfiguration.AddTarget(NLog.Targets.Target)'.
                       at Sdl.Community.DeepLMTProvider.Log.Setup()
                       at Sdl.Community.DeepLMTProvider.Log.GetLogger(String name)
                       at Sdl.Community.DeepLMTProvider.Studio.DeepLTranslationProviderConnecter..cctor()
                       --- End of inner exception stack trace ---
                       at Sdl.Community.DeepLMTProvider.Studio.DeepLTranslationProviderConnecter..ctor(String key, Formality formality)
                       at Sdl.Community.DeepLMTProvider.Studio.DeepLMtTranslationProviderFactory.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState,
                    ITranslationProviderCredentialStore credentialStore)
                       at Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState,
                    ITranslationProviderCredentialStore credentialStore)
                       at Sdl.ProjectApi.TranslationProviderCache.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore
                    credentialStore)
                       at Sdl.ProjectApi.TranslationProviderCache.GetTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore
                    credentialStore, Boolean performUpdate, Boolean refreshCache)
                       at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection,
                    Boolean performUpdate, Boolean refreshCache)
                       --- End of inner exception stack trace ---
                       at Sdl.ProjectAutomation.FileBased.Internal.AutomationServerEvents.HandleTranslationProviderException(TranslationProviderItem translationProviderItem, Exception
                    exception)
                       at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection,
                    Boolean performUpdate, Boolean refreshCache)
                       at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateProjectCascadeEntries(IList`1 projectCascadeEntryDataList, LanguagePair languagePair, Boolean readOnly, Boolean
                    refreshCache)
                       at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateCascade(ProjectCascadeSettings projectCascadeSettings, Boolean refreshCache)
                       at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, ProjectCascadeEntryDataFilterFunction filter, IComparer`1 sort,
                    Boolean readOnly, Boolean refreshCache)
                       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.<>c__DisplayClass5_0.<GetRecognizers>b__0()
                       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetOrCreateObject(String key, Func`1 createObject)
                       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetRecognizers(ILanguageDirection languageDirection)
                       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageTools(ILanguageDirection languageDirection)
                       at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.CreateAnalysisDataStorage(ILanguageDirection languageDirection, AnalysisTaskSettings analysisSettings,
                    TranslationMemorySettings translationMemorySettings, ILanguageObjectsCache objectsCache)
                       at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.Initialize(IList`1 files)
                       at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.CreateAnalysisDataCollectors()
                       at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.InitializeTask(IExecutingAutomaticTask task)
                       at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()
                       --- End of inner exception stack trace ---
                       at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()
                       at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()
                       at Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()
                       --- End of inner exception stack trace ---

  • I could it get it to work with Nlog.dll bundled with Studio 15. I didn't work either with Nlog 4.4.0 from Nuget, as per second stack trace. It worked using the following version though https://www.nuget.org/packages/NLog/4.3.11

    However, I am still getting a credentials error when PreTranslating. Workarounds here don't seem to work for me:

    DeepLTranslationProviderConnecter: 2022-02-15 18:42:27.9071 Error System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden).
    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
    at Sdl.Community.DeepLMTProvider.Studio.DeepLTranslationProviderConnecter.GetSupportedLanguages(String type, String apiKey)
    at Sdl.Community.DeepLMTProvider.Studio.DeepLTranslationProviderConnecter.GetSupportedSourceLanguages(String apiKey)

    However, when pretranslating from Trados a project created programmatically it works.

  • Hi ,

    Can you confirm that your DeepL API key is valid?

    reference from DeepL API document.

    403 Authorization failed. Please supply a valid auth_key parameter.

    https://www.deepl.com/docs-api/accessing-the-api/error-handling/

Reply Children
No Data