How to avoid key not found exception after installing plugin

Hello,

We got a report from a user of ours about getting an exception at startup when installing a plugin we developed (https://appstore.rws.com/plugin/189/). We could unblock the user by instructing to remove the plugin directories, but I'm looking for a bit more context to understand why/when such error can occur, and what better advice we could give to users.

Attached the stack trace - found these similar references on the forums:
- community.rws.com/.../key-not-found-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-parameter-name-key-when-opening-a-file
- community.rws.com/.../community-advance-display-filter-tabs-color-and-document-structure-are-empty

All seem to relate in some way to installing plugins and part of Trados getting confused.

What I'm interested to learn:

- Is this something that our plugin's configuration could likely cause, and if so is there anything we could do differently?

- Or if this is something that could generally happen when installing a new plugin, any advice on how to prevent it ( like close all projects before plugin install or such )?

- Would this happen consistently, that is if the user would try to install the plugin again, can they expect to run into the same problem, or is it more a one-off?

Why I'm curious about this, is that it is bad user experience to be greeted with this effect after plugin install (especially that it blocks Trados startup too), so I would like to prevent as much as possible.

Thank you for your insights,
Robin

<SDLErrorDetails time="06/02/2023 16:12:50">
  <ErrorMessage>Key not found: '03d5422d-8743-43a0-bb8b-8123202f8d8a'
Nombre del parámetro: key</ErrorMessage>
  <Exception>
    <Type>System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
    <ParamName>key</ParamName>
    <HelpLink />
    <Source>Infragistics.Shared</Source>
    <HResult>-2147024809</HResult>
    <StackTrace><![CDATA[   en Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key)
   en Infragistics.Win.UltraWinTabControl.UltraTabsCollection.get_Item(String key)
   en Sdl.Desktop.Platform.WinForms.DockingViewContentControl.SetActiveViewPart(IViewPartReference viewPartReference)
   en Sdl.Desktop.Platform.AbstractViewWithParts.set_ActiveViewPart(IViewPartReference value)
   en Sdl.TranslationStudio.Editor.EditorService.FocusActiveDocument()
   en Sdl.TranslationStudio.Editor.EditorService.OpenImpl(IDocumentDescriptor[] descriptors, IAbstractEditor[] editors, IEditorConfiguration[] configurations)
   en Sdl.TranslationStudio.Editor.EditorService.OpenTranslatableFiles(ITranslatableFile[] translatableFiles, WorkflowStage[] stages)
   en Sdl.TranslationStudio.Common.Files.FileUtil.OpenTranslatableFiles(IEditorService service, ITranslatableFile[] files, Nullable`1 workflowStage)
   en Sdl.TranslationStudio.Common.Files.FileListControl.OpenFilesInEditor(List`1 filesToOpenInEditor, Boolean controlKeyPressed)
   en Sdl.TranslationStudio.Common.Files.FileListControl.OpenFiles(IStudioWindow window, IProjectManagementService projectManagementService, EventArgs e, Boolean controlKeyPressed, ITranslatableTasksHandler tasksHandler, IEventAggregator aggregator)
   en Sdl.TranslationStudio.Common.Files.FileListControl.HandleDefaultAction(Object sender, EventArgs e)
   en Sdl.TranslationStudio.Common.Files.FileListControl.ListDefaultAction(Object sender, EventArgs e)
   en Sdl.Desktop.Common.DataList.OnDefaultAction(EventArgs e)
   en Sdl.Desktop.Common.DataList.BodyControl.OnDoubleClick(EventArgs e)
   en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   en System.Windows.Forms.ContainerControl.WndProc(Message& m)
   en System.Windows.Forms.UserControl.WndProc(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)]]></StackTrace>
  </Exception>
  <Environment>
    <ProductName>SDL Trados Studio</ProductName>
    <ProductVersion>Studio16</ProductVersion>
    <EntryAssemblyFileVersion>16.1.8.4404</EntryAssemblyFileVersion>
    <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
    <ServicePack>NULL</ServicePack>
    <OperatingSystemLanguage>3082</OperatingSystemLanguage>
    <CodePage>1252</CodePage>
    <LoggedOnUser>xxx</LoggedOnUser>
    <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
    <ComputerName>xxx</ComputerName>
    <ConnectedToNetwork>True</ConnectedToNetwork>
    <PhysicalMemory>16645784 MB</PhysicalMemory>
  </Environment>
</SDLErrorDetails>

emoji
Parents
  • Hi  ,  I will take a look at this, but can help me with answering a few questions first.

    1. I can see from the stack trace that the user has installed an older release of Trados Studio 2021 (e.g. SR1 CU8); is there a reason why they cannot upgrade to the latest release?
    2. Can you confirm that you were able to reproduce this issue on Trados 2021 SR1 CU8 and/or on the latet release of 2021 (e.g. 2021 SR2 CU12)?
    3. On what versions of Trados Studio is this reproduceable?

    I confirm that I can't reproduce the exception that you presented above against Trados Studio 2021 SR2 CU12.  It's difficult to identify what is causing this from the stacktrace you provided.  It could be related to a few things, but the most obvious would be the fact that the user is using an older release of Trados Studio SR1 cu8.
    It is know that plugins compiled aginst 2021 SR1 are not compatible with SR2 (& visa versa) as there were breaking changes to the API's introduced with SR2 for Trados Studio 2021.  If you compiled your plugin against Trados Studio SR2, then you can expect problems if a user is trying to load it in Trados Studio SR1 or earlier.

    emoji
  • Hi  , I 've just noticed a different bug when your plugin is loaded. 

    Steps to reproduce:

    1. Load Trados Studio 2021 SR2 CU12
    2. Install the Juremy.com Web Plugin / restart studio
    3. Select a project & open a document in the editor
      Note: make sure the Juremy.com Web Plugin is loaded in the view with the langauges selected.
    4. Open a second document from a different project with a different target langauge in the editor
    5. Switch between the two documents.

    Stack trace

    <SDLErrorDetails time="2/15/2023 4:40:08 PM">
      <ErrorMessage>Object reference not set to an instance of an object.</ErrorMessage>
      <Exception>
        <Type>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>Sdl.ProjectApi.Helpers</Source>
        <HResult>-2147467261</HResult>
        <StackTrace><![CDATA[   at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.GetCascadeSettings(ILanguageDirection languageDirection)
       at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, ProjectCascadeEntryDataFilterFunction filter, IComparer`1 sort, Boolean readOnly, Boolean refreshCache)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageResources(ILanguageDirection languageDirection)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.<>c__DisplayClass4_0.<GetLanguageResources>b__0(String _)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageResources(IProject project, Language language)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TokenizationContextBuilder.Build(CultureInfo culture)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TagFormattingDataProvider.ProcessDocumentTokens(SideBySideEditor editor, IList`1 suggestionData)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TagFormattingDataProvider.GetSuggestionData(EditingContext context)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Actions.LaunchTagFormattingWindowAction.GetSuggestionData(SideBySideEditor editor)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Actions.LaunchTagFormattingWindowAction.IsActionEnabled()
       at Sdl.TranslationStudio.Api.Implementation.Editor.AbstractActiveDocumentAction.UpdateAction()
       at Sdl.TranslationStudio.Api.Editor.AbstractSelectionDependentAction.OnSelectionChanged(IDocumentEditingView view)
       at Sdl.TranslationStudio.Api.Editor.DocumentEditingViewEventHandler.Invoke(IDocumentEditingView view)
       at Sdl.TranslationStudio.Editor.TranslationEditor.SelectionChangedDelayedEventHandler.<>c__DisplayClass27_0.<FireEvent>b__0()
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()]]></StackTrace>
      </Exception>
      <Environment>
        <ProductName>Trados Studio</ProductName>
        <ProductVersion>Studio16</ProductVersion>
        <EntryAssemblyFileVersion>16.2.12.9338</EntryAssemblyFileVersion>
        <OperatingSystem>Microsoft Windows 10 Pro</OperatingSystem>
        <ServicePack>NULL</ServicePack>
        <OperatingSystemLanguage>1033</OperatingSystemLanguage>
        <CodePage>1250</CodePage>
        <LoggedOnUser>GLOBAL\phartnett</LoggedOnUser>
        <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
        <ComputerName>ROMSDEPHARTNE02</ComputerName>
        <ConnectedToNetwork>True</ConnectedToNetwork>
        <PhysicalMemory>32758140 MB</PhysicalMemory>
      </Environment>
    </SDLErrorDetails>

    /cfs-file/__key/communityserver-discussions-components-files/58/3252.sdlerror_2D00_2023215_2D00_16h39m29s.sdlerror.xml

    emoji
Reply
  • Hi  , I 've just noticed a different bug when your plugin is loaded. 

    Steps to reproduce:

    1. Load Trados Studio 2021 SR2 CU12
    2. Install the Juremy.com Web Plugin / restart studio
    3. Select a project & open a document in the editor
      Note: make sure the Juremy.com Web Plugin is loaded in the view with the langauges selected.
    4. Open a second document from a different project with a different target langauge in the editor
    5. Switch between the two documents.

    Stack trace

    <SDLErrorDetails time="2/15/2023 4:40:08 PM">
      <ErrorMessage>Object reference not set to an instance of an object.</ErrorMessage>
      <Exception>
        <Type>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>Sdl.ProjectApi.Helpers</Source>
        <HResult>-2147467261</HResult>
        <StackTrace><![CDATA[   at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.GetCascadeSettings(ILanguageDirection languageDirection)
       at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, ProjectCascadeEntryDataFilterFunction filter, IComparer`1 sort, Boolean readOnly, Boolean refreshCache)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageResources(ILanguageDirection languageDirection)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.<>c__DisplayClass4_0.<GetLanguageResources>b__0(String _)
       at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
       at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageResources(IProject project, Language language)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TokenizationContextBuilder.Build(CultureInfo culture)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TagFormattingDataProvider.ProcessDocumentTokens(SideBySideEditor editor, IList`1 suggestionData)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Intellisense.TagFormattingDataProvider.GetSuggestionData(EditingContext context)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Actions.LaunchTagFormattingWindowAction.GetSuggestionData(SideBySideEditor editor)
       at Sdl.TranslationStudio.Editor.TranslationEditor.Actions.LaunchTagFormattingWindowAction.IsActionEnabled()
       at Sdl.TranslationStudio.Api.Implementation.Editor.AbstractActiveDocumentAction.UpdateAction()
       at Sdl.TranslationStudio.Api.Editor.AbstractSelectionDependentAction.OnSelectionChanged(IDocumentEditingView view)
       at Sdl.TranslationStudio.Api.Editor.DocumentEditingViewEventHandler.Invoke(IDocumentEditingView view)
       at Sdl.TranslationStudio.Editor.TranslationEditor.SelectionChangedDelayedEventHandler.<>c__DisplayClass27_0.<FireEvent>b__0()
       at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
       at System.Windows.Forms.Control.InvokeMarshaledCallbacks()]]></StackTrace>
      </Exception>
      <Environment>
        <ProductName>Trados Studio</ProductName>
        <ProductVersion>Studio16</ProductVersion>
        <EntryAssemblyFileVersion>16.2.12.9338</EntryAssemblyFileVersion>
        <OperatingSystem>Microsoft Windows 10 Pro</OperatingSystem>
        <ServicePack>NULL</ServicePack>
        <OperatingSystemLanguage>1033</OperatingSystemLanguage>
        <CodePage>1250</CodePage>
        <LoggedOnUser>GLOBAL\phartnett</LoggedOnUser>
        <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
        <ComputerName>ROMSDEPHARTNE02</ComputerName>
        <ConnectedToNetwork>True</ConnectedToNetwork>
        <PhysicalMemory>32758140 MB</PhysicalMemory>
      </Environment>
    </SDLErrorDetails>

    /cfs-file/__key/communityserver-discussions-components-files/58/3252.sdlerror_2D00_2023215_2D00_16h39m29s.sdlerror.xml

    emoji
Children