OpenAI Provider for Trados makes Studio crash once every second time after opening a file

Hello

I have open a ticket with support, but they cannot help me because the problem is generated by OpenAI Provider for Trados (Studio 2024). This is the ticket (even if the problem at the beginning was another, look at the last comments): https://gateway.sdl.com/communitycasedetail?caseId=500Vm00000BBlLTIA1

Every now and then Studio crashes after opening a file and the culprit is the plugin OpenAI (in the stacktrace, see attached files).

I did many things to try to fix the problem:

  1. I deleted the prompts in Italian and redid everything in English as I thought maybe this was the problem.
  2. I deleted all settings and started from scratch in Studio
  3. I installed Windows from scratch (but I have the same problem also on my laptop, so it should not be related to Windows installation)
  4. I disabled the Termbase Viewer, as Studio crashes everytime I open a file and the Termbase Viewer tries to load a termbase (a couple of minutes).
  5. I hid the Termbase Viewer for the same reason.

Nothing was useful. Studio does not crash only when OpenAI Provider is disabled or uninstalled. But I need it to work, as when it does not crash it is a powerful tool to improve productivity.

This did not happen with the last Beta of Studio 2024.

Can somebody help please? Thank you and kind regards,

Angelo

<SDLErrorDetails time="24.07.2024 12:39:06">
  <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>OpenAI.Provider</Source>
    <HResult>-2147467261</HResult>
    <StackTrace><![CDATA[   at OpenAI.Provider.ViewModel.TranslationViewModel.GetTranslationCacheItem()
   at OpenAI.Provider.ViewModel.TranslationViewModel.<>c__DisplayClass134_0.<OnChangeSegment>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Sdl.TranslationStudio.Application.Launcher.RunApplication()]]></StackTrace>
  </Exception>
  <Environment>
    <ProductName>Trados Studio</ProductName>
    <ProductVersion>Studio18</ProductVersion>
    <EntryAssemblyFileVersion>18.0.0.1013</EntryAssemblyFileVersion>
    <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
    <ServicePack>NULL</ServicePack>
    <OperatingSystemLanguage>1040</OperatingSystemLanguage>
    <CodePage>1252</CodePage>
    <LoggedOnUser>Office2022Win11\angelo.caltagirone</LoggedOnUser>
    <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
    <ComputerName>OFFICE2022WIN11</ComputerName>
    <ConnectedToNetwork>True</ConnectedToNetwork>
    <PhysicalMemory>33257044 MB</PhysicalMemory>
  </Environment>
</SDLErrorDetails>
<SDLErrorDetails time="26.07.2024 09:09:21">
  <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>OpenAI.Provider</Source>
    <HResult>-2147467261</HResult>
    <StackTrace><![CDATA[   at OpenAI.Provider.ViewModel.TranslationViewModel.GetTranslationCacheItem()
   at OpenAI.Provider.ViewModel.TranslationViewModel.<>c__DisplayClass134_0.<OnChangeSegment>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Sdl.TranslationStudio.Application.Launcher.RunApplication()]]></StackTrace>
  </Exception>
  <Environment>
    <ProductName>Trados Studio</ProductName>
    <ProductVersion>Studio18</ProductVersion>
    <EntryAssemblyFileVersion>18.0.0.1013</EntryAssemblyFileVersion>
    <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
    <ServicePack>NULL</ServicePack>
    <OperatingSystemLanguage>1040</OperatingSystemLanguage>
    <CodePage>1252</CodePage>
    <LoggedOnUser>Office2022Win11\angelo.caltagirone</LoggedOnUser>
    <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
    <ComputerName>OFFICE2022WIN11</ComputerName>
    <ConnectedToNetwork>True</ConnectedToNetwork>
    <PhysicalMemory>33257044 MB</PhysicalMemory>
  </Environment>
</SDLErrorDetails>

emoji
  • It happened again. But this time after reopening Studio I had this new message:

    <SDLErrorDetails time="07.08.2024 15:41:45">
      <ErrorMessage>Collection was modified; enumeration operation may not execute.</ErrorMessage>
      <Exception>
        <Type>System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
        <HelpLink />
        <Source>mscorlib</Source>
        <HResult>-2146233079</HResult>
        <StackTrace><![CDATA[   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
       at Sdl.TranslationStudio.Editor.Terminology.ProjectTermbasesLoader.CancelAllInitializing()
       at Sdl.TranslationStudio.Editor.Terminology.ProjectTermbasesLoader.Dispose()
       at Sdl.TranslationStudio.Editor.Terminology.TermAccessProvider.Dispose()
       at Sdl.TranslationStudio.Editor.EditorService.OnApplicationStop(OnApplicationStopEvent e)
       at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
       at System.Reactive.Sink`1.ForwardOnNext(TTarget value)
       at System.Reactive.IdentitySink`1.OnNext(T value)
       at System.Reactive.Sink`1.ForwardOnNext(TTarget value)
       at System.Reactive.Linq.ObservableImpl.OfType`2._.OnNext(TSource value)
       at System.Reactive.Subjects.Subject`1.OnNext(T value)
       at Sdl.Desktop.Platform.Implementation.Services.EventAggregator.Publish[TEvent](TEvent sampleEvent)
       at Sdl.Desktop.Platform.Implementation.Studio.Exit(Boolean restart, String[] restartArguments)
       at Sdl.Desktop.Platform.Implementation.Studio.Close(Boolean restart, String[] restartArguments)
       at Sdl.Desktop.Platform.Implementation.Studio.Close()
       at Sdl.TranslationStudio.Application.Launcher.RunApplication()
       at Sdl.TranslationStudio.Application.Launcher.Main(String[] args)]]></StackTrace>
      </Exception>
      <Environment>
        <ProductName>Trados Studio</ProductName>
        <ProductVersion>Studio18</ProductVersion>
        <EntryAssemblyFileVersion>18.0.0.1013</EntryAssemblyFileVersion>
        <OperatingSystem>Microsoft Windows 11 Pro</OperatingSystem>
        <ServicePack>NULL</ServicePack>
        <OperatingSystemLanguage>1040</OperatingSystemLanguage>
        <CodePage>1252</CodePage>
        <LoggedOnUser>Office2022Win11\angelo.caltagirone</LoggedOnUser>
        <DotNetFrameWork>4.0.30319.42000</DotNetFrameWork>
        <ComputerName>OFFICE2022WIN11</ComputerName>
        <ConnectedToNetwork>True</ConnectedToNetwork>
        <PhysicalMemory>33257044 MB</PhysicalMemory>
      </Environment>
    </SDLErrorDetails>

    emoji
  • Hi   - the first errors seem to come from the cache within the OpenAI Provider. Can you try disabling the cache in the options to see if this stabilizes the provider? I know this may increase traffic and cost but it might be good to try and isolate this to that option and we can then take things from there.

    Screenshot of RWS AppStore Applications settings showing options under 'Search Options' with 'Use In-process caching' checked and a 'Reset cache' button.

    You could also experiment just with resetting cache before opening a new file.


    Thanks, Daniel

    Daniel Brockmann
    Team Trados @ RWS

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 11:45 AM (GMT 1) on 9 Aug 2024]
  • Hi  

    Thank you for your reply. This option is always disabled when I set it in my project, as ChatGPT 4o is not so expensive as ChatGPT 4 and sometimes when I do not like the translation provided by OpenAI I just do a new lookup to find another translation. If this option is active, I get always the same proposal because it is in the cache.

    The problem is, that Studio crashes (mostly) when OpenAI is not set as a TM provider, but in the stacktrace the culprit is OpenAI provider. Our projects are prepared in GS, I am the only one using 2024 for now, so these projects do not come with OpenAI provider active in the project settings. I insert it manually. When I insert OpenAI Provider in a projects, this option is enabled by default, so I cannot deactivate it before I open the file, when the provider is not even set.

    The only change I made (it just occurred to me now) is that I deleted the default Connection with ChatGPT 3.5 turbo provided by Studio, as I am not satisfied with the outcome. I deleted it because it came always as default and I always had to change the connection to select ChatGPT 4o when I set OpenAI provider as a TM provider. But I cannot imagine, that this could be the problem. Or could it be?

    Thank you for your reply and kind regards

    Angelo

    emoji
  • OK - next option could be to go to c:\Users\<YourUserName>\AppData\Roaming\Trados AppStore\Trados Copilot - AI Assistant\Settings and perhaps rename/delete the XML files there to reset to default, then set your options again to see if this stabilizes. Perhaps some old settings are interfering. Both the Connections.xml and the ProviderSettings.xml files could be interesting to consider in this. Thanks, Daniel

    Daniel Brockmann
    Team Trados @ RWS

    emoji
  • you mean C:\Users\angelo.caltagirone\AppData\Roaming\Trados AppStore\OpenAI Provider for Trados

    I will do it for both folders

    emoji
  • Yes apologies, it's the latter. (The former was from the beta phase). Thanks, Daniel

    Daniel Brockmann
    Team Trados @ RWS

    emoji
  • Hi , thank you very much, I think we found the culprit. I did not have any crash related to OpenAI since Friday. Today I opened files several times and I did not have one crash.

    I took the same prompts as I had before, so they were not the problem. Maybe something in the connections. Anyway, at the moment it is working.

    I let you know, if I have any issues regarding crashes from Studio.

    Kind regards,

    Angelo

    emoji
  • OK great to hear, thanks Angelo. Perhaps the 'fiddling' with the cache fixed the problem, great to hear it works again (phew). Thanks, Daniel

    Daniel Brockmann
    Team Trados @ RWS

    emoji
  • Hi Daniel,

    A client is experiencing same issue, it works for few minutes by deleting the XML files, but soon it happened again, any idea?

    Thank you,

    Jinpan

    emoji
  • Thank you for bringing this to our attention. Our development team will review it in the context of our ongoing projects and priorities. Your understanding and patience as we assess this matter is appreciated. We have recorded the issue in our tracking system under the reference number CRQ-39858
    emoji