Studio 2022; error message 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'

When I launch the QA controls on the file I'm working on with F8, I get this message. and the QA checks are interrupted
I am working on a package received from a client, which includes a Termbase. If I deactivate the Termbase from the project settings, the error disappears and QA checks are completed correctly.
Verification settings include terminology checks. If I do not remove the termbase but disable terminology checks, QA is carried out correctly.
I am running Trados Studio 2022 SR1 - 17.1.6.16252, Multiterm 2022 SR1 - 17.1.1.2185, and Windows 11 duly updated.

I attach the error stack:

<SDLErrorDetails time="14/07/2023 13:51:55">
  <ErrorMessage>Failed to verify document: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index</ErrorMessage>
  <Exception>
    <Type>System.ArgumentOutOfRangeException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
    <ParamName>index</ParamName>
    <HelpLink />
    <Source>mscorlib</Source>
    <HResult>-2146233086</HResult>
    <StackTrace><![CDATA[   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Sdl.Verification.TermVerifier.TermVerifierProcessing.HasAnyForbiddenFields(ISegment target, Boolean found, ITermRecognitionHit hit, IEntryTerm term)
   at Sdl.Verification.TermVerifier.TermVerifierProcessing.CheckForbiddenTerms(ISegment target)
   at Sdl.Verification.TermVerifier.TermVerifierProcessing.Verify(ISegment source, ISegment target, Boolean sourceHasRevisions, Boolean targetHasRevisions)
   at Sdl.Verification.TermVerifier.TermVerifierMain.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.BilingualContentHandlerAdapter.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.BilingualContentHandlerAdapter.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.BilingualContentHandlerAdapter.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Integration.AbstractBilingualProcessorContainer.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.BilingualApi.AbstractBilingualContentProcessor.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Integration.LocationMarkerLocator.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Integration.AbstractBilingualProcessorContainer.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Framework.Integration.FileExtractor.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.vv_Visit(TmfcReaderImpl* , FrameworkParagraphContainerField* field)
   at FrameworkParagraphContainerField.vv_AcceptFrameworkVisitor(FrameworkParagraphContainerField* , FrameworkFieldVisitor* visitor)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.vv_VisitStartEndField(TmfcReaderImpl* , StartEndField* startEnd)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.b_VisitNext(TmfcReaderImpl* )
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReader.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.FileExtractor.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.MultiFileConverter.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.MultiFileConverter.Parse()
   at Sdl.TranslationStudio.Editor.Verification.VerifyDocumentJobRequest.PerformBilingualVerification()
   at Sdl.TranslationStudio.Editor.Verification.VerifyDocumentJobRequest.Execute(IJobExecutionContext context)
   at Sdl.Desktop.Platform.Implementation.Services.JobExecuter.Execute(JobData jobData)
   at Sdl.Desktop.Platform.Implementation.ResourceLoggingInternalCommandExecuter`1.ExecuteWithResourceLogging(TCommandData commandData, String message)
   at Sdl.Desktop.Platform.Implementation.Services.Job._worker_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)]]></StackTrace>
  </Exception>
  <Environment>
    <ProductName>Trados Studio</ProductName>
    <ProductVersion>Studio17</ProductVersion>
    <EntryAssemblyFileVersion>17.1.6.16252</EntryAssemblyFileVersion>
    <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
    <ServicePack>NULL</ServicePack>
    <OperatingSystemLanguage>1040</OperatingSystemLanguage>
    <CodePage>1252</CodePage>
    <LoggedOnUser>DESKTOP-K15369G\FDL</LoggedOnUser>
    <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
    <ComputerName>DESKTOP-K15369G</ComputerName>
    <ConnectedToNetwork>True</ConnectedToNetwork>
    <PhysicalMemory>33255512 MB</PhysicalMemory>
  </Environment>
</SDLErrorDetails>

Thanks for your help.

Kind regards

Fulvio Giglio
 

emoji
Parents
  •  

    Thanks for providing these details.  By looking at the stack trace, it looks as though the problem may be coming from the method "HasAnyForbiddenFields" in the class "TermVerifierProcessing",,, maybe this:

    • CheckForbiddenTerms receives a target segment as an argument.
    • This function then calls HasAnyForbiddenFields, passing the target segment along with other parameters.
    • Within HasAnyForbiddenFields, the function attempts to access an element in a collection at a specific index.
    • However, the specified index is larger than the number of elements in the collection (i.e., it's out of range), resulting in an ArgumentOutOfRangeException.

    Can you share the settings you are using here?

    Screenshot showing the verification settings page.

    Maybe also try changing your settings so you don't check for forbidden terms?  Just as a test... clearly it should always work, and preferably should not throw an error even if your termbase has a problem.  If possible can you share your termbase?  Or maybe a screenshot of your termbase definition if your termbase cannot be shared?

    Screenshot showing the termbase definition settings

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
Reply
  •  

    Thanks for providing these details.  By looking at the stack trace, it looks as though the problem may be coming from the method "HasAnyForbiddenFields" in the class "TermVerifierProcessing",,, maybe this:

    • CheckForbiddenTerms receives a target segment as an argument.
    • This function then calls HasAnyForbiddenFields, passing the target segment along with other parameters.
    • Within HasAnyForbiddenFields, the function attempts to access an element in a collection at a specific index.
    • However, the specified index is larger than the number of elements in the collection (i.e., it's out of range), resulting in an ArgumentOutOfRangeException.

    Can you share the settings you are using here?

    Screenshot showing the verification settings page.

    Maybe also try changing your settings so you don't check for forbidden terms?  Just as a test... clearly it should always work, and preferably should not throw an error even if your termbase has a problem.  If possible can you share your termbase?  Or maybe a screenshot of your termbase definition if your termbase cannot be shared?

    Screenshot showing the termbase definition settings

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
Children