XUnity.AutoTranslator icon indicating copy to clipboard operation
XUnity.AutoTranslator copied to clipboard

DeepL - Invalid JSON-RPC request during translation

Open laurencee opened this issue 1 year ago • 0 comments

Originaly posted to https://github.com/BepInEx/BepInEx/issues/493

What happened?

With the game "The Scroll of Taiwu", when using DeepL translation some text isn't being formatted correctly when being sent for translation resulting in the following HttpRequest error Response status code does not indicate success: 400 (Invalid JSON-RPC request)

Steps to reproduce

Attempt to DeepL translate the following in game text “识茶之人皆知此理……”司马谨晏似乎并无太大兴致……

BepInEx Distribution

Stable from GitHub

Log outputs

[Message:   BepInEx] BepInEx 5.4.21.0 - The Scroll of Taiwu (22/09/2022 4:25:31 PM)
[Info   :   BepInEx] Running under Unity v2018.4.23.13225754
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.21.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 2 plugins to load
[Info   :   BepInEx] Loading [XUnity Auto Translator 5.1.0]
[Info   :XUnity.AutoTranslator] Version of TextMesh Pro: 1.4.0.
[Info   :XUnity.AutoTranslator] Loaded XUnity.AutoTranslator into Unity [2018.4.23f1] game.
[Info   :   BepInEx] Loading [XUnity Resource Redirector 2.0.0]
[Message:   BepInEx] Chainloader startup complete
[Info   :XUnity.AutoTranslator] Skipping plugin scan because no plugin-specific translations has been registered.
[Error  :XUnity.AutoTranslator] Error occurred while retrieving translation. An error occurred in the pipeline.
System.Exception: Found no valid translations in beam!
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.ExtractTranslation(String data, List`1 untranslatedTextInfos, ITranslationContext context)
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.<Translate>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Http.ExtProtocol.Executor.ExtProtocolHandler.<RunAsync>d__4.MoveNext()
[Error  :XUnity.AutoTranslator] Failed: '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊'
[Error  :XUnity.AutoTranslator] Error occurred while retrieving translation. An error occurred in the pipeline.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Invalid JSON-RPC request).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.<Translate>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Http.ExtProtocol.Executor.ExtProtocolHandler.<RunAsync>d__4.MoveNext()
[Error  :XUnity.AutoTranslator] Failed: '“竟还有这样的道理!那我定然要试试的……”司马谨晏点头道……'
[Error  :XUnity.AutoTranslator] Error occurred while retrieving translation. An error occurred in the pipeline.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Invalid JSON-RPC request).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.<Translate>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Http.ExtProtocol.Executor.ExtProtocolHandler.<RunAsync>d__4.MoveNext()
[Error  :XUnity.AutoTranslator] Failed: '“我好似曾经见过,原来竟叫八蜡……”司马谨晏点头道……'
[Error  :XUnity.AutoTranslator] Error occurred while retrieving translation. An error occurred in the pipeline.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Invalid JSON-RPC request).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.<Translate>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Http.ExtProtocol.Executor.ExtProtocolHandler.<RunAsync>d__4.MoveNext()
[Error  :XUnity.AutoTranslator] Failed: '“识茶之人皆知此理……”司马谨晏似乎并无太大兴致……'
[Error  :XUnity.AutoTranslator] Error occurred while retrieving translation. An error occurred in the pipeline.
System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Invalid JSON-RPC request).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at DeepLTranslate.ExtProtocol.ExtDeepLTranslate.<Translate>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Http.ExtProtocol.Executor.ExtProtocolHandler.<RunAsync>d__4.MoveNext()
[Error  :XUnity.AutoTranslator] Failed: '“识茶之人皆知此理……”司马谨晏似乎并无太大兴致……'
[Error  :XUnity.AutoTranslator] Error occurred while reading standard output from external process.
System.Threading.ThreadAbortException
  at (wrapper managed-to-native) System.IO.MonoIO.Read(intptr,byte[],int,int,System.IO.MonoIOError&)
  at System.IO.MonoIO.Read (System.Runtime.InteropServices.SafeHandle safeHandle, System.Byte[] dest, System.Int32 dest_offset, System.Int32 count, System.IO.MonoIOError& error) [0x00010] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.FileStream.ReadData (System.Runtime.InteropServices.SafeHandle safeHandle, System.Byte[] buf, System.Int32 offset, System.Int32 count) [0x00002] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.FileStream.ReadInternal (System.Byte[] dest, System.Int32 offset, System.Int32 count) [0x00026] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.FileStream.Read (System.Byte[] array, System.Int32 offset, System.Int32 count) [0x000a1] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.StreamReader.ReadBuffer () [0x000b3] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.StreamReader.ReadLine () [0x00021] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at XUnity.AutoTranslator.Plugin.Core.Endpoints.ExtProtocol.ExtProtocolEndpoint.ReaderLoop (System.Object state) [0x00140] in <369dd9e4fbad4897a4fae8235ba4292d>:0

Environment

- OS: Windows 10 x64
- BepInEx: 5.4.21.0
- Game: The Scroll of Taiwu

laurencee avatar Sep 30 '22 09:09 laurencee