Batch Task “Pretranslate”/ ”Word Count” API call fails randomly

After migrating to Trados Studio 2021 from SDL Trados Studio 2017, we have come across the following major issue in the implementation of our automated processes (using the Trados public APIs):

Batch Task “Pretranslate”/ ”Word Count”: randomly fails with the following exception:

“Unexpected exception when configuring file multiFileConverter for task 'Word Count': Failed to create an instance of translation provider 'sdltm.XXX/

“Unexpected exception when configuring file multiFileConverter for task 'Pre-translate Files': Failed to create an instance of translation provider 'sdltm.file:///P:/PathToTheTM/nameOfTheTm.sdltm'..”

 

This issue has been replicated on our side using a simple Filebased Project with 2 simple docx translatable files, an empty FileBased TM while running the batch task “Pretranslate” on a loop.

 

As you can see, this problem occurs both with FileBased and ServerBased TMs.

Through trial-and-error, we have noticed the following:

  • The problem occurs only with projects that have more than one translatable file.
  • The problem does not occur if the batch task is applied for each translatable file separately.
  • The problem will occur after running the task a couple of times. The first few times the task is run, there is no issue.
  • Once the problem occurs, it keeps occurring until either a long time has gone by or the PC is rebooted (even if after the problem occurs we try to run the batch task for each file separately).

Details of the Exception fetched From Visual Studio:

System.IndexOutOfRangeException

  HResult=0x80131508

  Message=Index was outside the bounds of the array.

  Source=Sdl.Core.PluginFramework

  StackTrace:

   at Sdl.Core.PluginFramework.ObjectRegistry`2.CreateObjects()

 

  This exception was originally thrown at this call stack:

    Sdl.Core.PluginFramework.ObjectRegistry<TExtensionAttribute, TExtensionType>.CreateObjects()

 

This is a serious issue with a major negative impact on our productivity.
Can anyone from RWS give me an official answer on what to do? This was working perfectly fine until the upgrade to Trados 2021.
Is this going to be fixed soon on an upcoming update?
Is there a way to circumvent the problem in the meantime?

Thank you in advance!


emoji
  • Hello  !

    Unfortunately, it seems like a workaround will have to do for now.

    We discovered a similar issue for another team recently, but we were unable to identify the root cause after a preliminary investigation. Until we have more concrete information, we recommend the following workaround.

    Introduce a fail-safe action to automatically restart the process of running the project automation tasks when it discovers a failed attempt. This should open a new instance of the project and not use the same instance of the project with the failed attempt.

    You can find a code sample for this here.

    emoji
  • Hi Emanual,

    Thank you for your response.

    With great disappointment, I have to point out that neither this second solution provided works.
    I am under the impression that the time required for the resolution of such a serious bug is not properly invested.

    I am not quite sure if the code sample was supposed to be working as is, since I found some “bugs” that I had to fix in order to successfully run it.

    Regardless of the procedure, the result is that once the task fails, it continues to fail and that the workaround doesn’t work.

    Here is a screenshot of the output:

    Screenshot of Trados Studio error log showing repeated 'Object reference not set to an instance of an object' errors during 'Translate Files' task, indicating a persistent bug. 

    I will repeat myself and remind you that the fact that the same bug -referenced in a previous message of mine- was reported almost seven months ago and no resolution was found makes me very very nervous.

    As you know, Trados is quite an expensive product, for which we (as a company) have purchased a large number of licenses. This alone is a good enough reason to merit complete resolution of an issue, especially when this issue is encountered in one of the most common -and important- batch tasks.

    Until the full resolution of the bug, a workaround that works is mandatory.

    I will be expecting an update.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 1:42 PM (GMT 0) on 5 Mar 2024]
  • Hi   thank you for your feedback and the sample project; appreciated.

    I am not quite sure if the code sample was supposed to be working as is, since I found some “bugs” that I had to fix in order to successfully run it.

    Can you please create a PR with the bug fixes that you applied against the public project example on github that  provided to you?  It isn't often that we get third-party developers wanting to get involved, contributing to the sample projects, with the objective of helping other developers in solving problems/ workarounds.

    I am under the impression that the time required for the resolution of such a serious bug is not properly investe

    Although I understand your frustration in not having a solution or workaround to resolve this -> contrary to what you are suggesting, we have reorganized our priorities to review the problem you are reporting.

    I will repeat myself and remind you that the fact that the same bug -referenced in a previous message of mine- was reported almost seven months ago and no resolution was found makes me very very nervous.

    We are reviewing the issue you have reported here, in these days.  Have you reported this same issue in another form on the community; pls add the link here for reference.

    Until the full resolution of the bug, a workaround that works is mandatory.

    'Mandatory' might be a poor choice of wording here, unless you are ordering us to provide you with a workaround.  Are you ordering us to provide you with a workaround?

    Let's recap to understand where we are:

    1. We reviewed the problem that you presented, given the conditions you disclosed about your process.
    2. We have been able to reproduce the problem in at least one occasion where the proposed solution by  resolved the issue.
    3. We presented this as a potential solution so that you could confirm if it resolves the problem on your system
    4. You have reported that the proposed solution doesn't resolve the problem on your system.

    Correct?

    My Review:

    I have taken time this evening to review this issue, using your sample project and confirm that I can reproduce the same issue you are reporting.  Sometimes it occurs once, other times all the time.  I don't see a work around for this without reviewing the abstract levels from the Trados Studio solution.

    For now, I will escalate this issue to the Studio Team, but it might be that we pick this up and collaborate with the Studio team to resolve. We'll circle back to you once we have more concrete information.

     ,  

    Reproducible on Trados Studio 2021 SR2+ and 2022

    Tech Notes:

    After reviewing the sample project that you provided above, I would recommend to include the execution of the batch task within an iteration of the project target languages, as follows:

    var targetLanguages = studioProject.GetProjectInfo().TargetLanguages;
    foreach (var targetLanguage in targetLanguages)
    {
    	var targetFiles = studioProject.GetTargetLanguageFiles(targetLanguage);
    	var task = studioProject.RunAutomaticTask(
    		targetFiles.GetIds(), AutomaticTaskTemplateIds.PreTranslateFiles);
    	//[...]
    }

    Note: this will not solve the problem you have discovered, but will enable you to separate execution of the batch tasks by target language.

    emoji
  • Hello  ,

    Thank you very much for the time invested in this issue.

    Can you please create a PR with the bug fixes that you applied against the public project example on github that  provided to you?  It isn't often that we get third-party developers wanting to get involved, contributing to the sample projects, with the objective of helping other developers in solving problems/ workarounds.

    I am not a software developer, whilst having a developing background. I will instruct my developers to “prettify” the code and upload it.

    Although I understand your frustration in not having a solution or workaround to resolve this -> contrary to what you are suggesting, we have reorganized our priorities to review the problem you are reporting.

    Thank you very much for your actions.

    We are reviewing the issue you have reported here, in these days.  Have you reported this same issue in another form on the community; pls add the link here for reference.

    The link has already been posted for reference purposes on one of my first replies.

    'Mandatory' might be a poor choice of wording here, unless you are ordering us to provide you with a workaround.  Are you ordering us to provide you with a workaround?

    I am indeed in no position to order you about anything, so please excuse my  poor choice of wording.

    I am though in the position where the company where I work as a production manager has spent about 30.000 euros in May to upgrade to Trados 2021 - and over 70000 euros in the last 10 years or so for SDL now RWS products - and is losing money for the last two months because the upgraded product isn’t working as advertised.

    Let me leave a note here and inform you that before the upgrade, Trados 2017 was working perfectly.

    Let's recap to understand where we are:

    1. We reviewed the problem that you presented, given the conditions you disclosed about your process.
    2. We have been able to reproduce the problem in at least one occasion where the proposed solution by  resolved the issue.
    3. We presented this as a potential solution so that you could confirm if it resolves the problem on your system
    4. You have reported that the proposed solution doesn't resolve the problem on your system.

    1. Accurate.

    2. Not accurate
    The issue was never resolved, the proposed solution was not even applicable in this situation (didn’t run pre-translate in a loop). If more information is needed  everything is documented in the thread.

    3. The solution is not relevant to the issue.

    4. Please see 3

    My Review:

    I have taken time this evening to review this issue, using your sample project and confirm that I can reproduce the same issue you are reporting.  Sometimes it occurs once, other times all the time.  I don't see a work around for this without reviewing the abstract levels from the Trados Studio solution.

    For now, I will escalate this issue to the Studio Team, but it might be that we pick this up and collaborate with the Studio team to resolve. We'll circle back to you once we have more concrete information.

     ,  

    Reproducible on Trados Studio 2021 SR2+ and 2022

    I am in no position to know the internal workings and procedures of RWS Trados and who does the technical support or if it is even outsourced. From my point of view everyone answering in this thread represents RWS Trados.


    The facts are that there was a product upgrade purchased for a hefty amount of money, it isn’t working as promised and as a result we are losing money and time.
    Please excuse my irritated tone, but we have been experiencing the results of the bug for over two months.

    Tech Notes:

    After reviewing the sample project that you provided above, I would recommend to include the execution of the batch task within an iteration of the project target languages, as follows:

    Thank you for the recommendation, but in our case doesnt really help since the problem is encountered in single target language projects.

    Finally, please let me inform you that I am not trying to pick a fight here.

    I am reporting too to people whom I have convinced regarding the necessity to upgrade to Trados 2021 and since the upgrade I have been reporting back that Trados and all of our automations aren't working. I am sure you can understand my frustration.


    Please inform me regarding the nexts steps and If there is another place where I should escalate the issue.

    emoji
  • Hello everyone,

    I hope you had a nice summer.

    Do we have any news regarding the bug or the timeline of the fix?

    Thank you in advance!

     

     

     

    emoji
  • Hi , I don't have an update on this issue other than the studio team are reviewing it.

    Adding  to the thread.

    emoji
  • Just as an update here for everyone, this was tracked as CRQ-30444 and was addressed in Studio 2022 SR1 CU7 and higher. Another robustness fix was done for Studio 2022 SR2 (in December 2023). So hopefully this has been addressed in the meantime.

    Daniel Brockmann
    Team Trados @ RWS