drizzle-mizzle / Character-Engine-Discord

(not yet very) Ultimate LLMs aggregator right in your Discord server
https://discord.gg/JtVzgJ8Znh
GNU General Public License v3.0
105 stars 47 forks source link

Puppeteer browser error loop when spawning character #13

Open elevatorctln opened 9 months ago

elevatorctln commented 9 months ago

When I try to spawn a character for character.ai, I get a looping error in the console

"Failed to kill browser. This error won't affect the workflow of the application, but if you will relaunch it and see this error again, it will mean that the old Puppeteer browser process probably is still running in the background and consumes the RAM on your machine.

Exception details:
System.ComponentModel.Win32Exception (299): Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
   at System.Diagnostics.NtProcessManager.EnumProcessModulesUntilSuccess(SafeProcessHandle processHandle, IntPtr[] modules, Int32 size, Int32& needed, Int32 filterFlag)
   at System.Diagnostics.NtProcessManager.GetModules(Int32 processId, Boolean firstModuleOnly)
   at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)
   at CharacterAI.Services.PuppeteerService.KillBrowser()"

I've tried manually setting the paths in the config to the chrome folder path and chrome.exe path, that did not fix the issue. After the error it launches the browser again and opens character.ai again, both successfully according to it, and then throws the same error again.

drizzle-mizzle commented 8 months ago

Try with the latest update and see if error gone away

elevatorctln commented 8 months ago

Still fails to kill browser, but with a different error and on dotnet run this time instead of when the character is spawned. The bot does not come online. I also see chromium in task manager taking CPU and RAM usage this time which I did not with the first error

Found installed browser: C:\Users\caitl\Character-Engine-Discord\puppeteer-chrome\Chromium\Win64-1249938\chrome-win\chrome.exe
(Warning) Failed to kill browser instances
Exception details:
System.ComponentModel.Win32Exception (0x80004005): Unable to enumerate the process modules.
   at System.Diagnostics.NtProcessManager.GetModules(Int32 processId, Boolean firstModuleOnly)
   at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)
   at CharacterAI.Client.CharacterAiClient.<>c__DisplayClass6_0.<EnsureAllChromeInstancesAreKilled>b__0(Process proc)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at CharacterAI.Client.CharacterAiClient.EnsureAllChromeInstancesAreKilled()
drizzle-mizzle commented 8 months ago

This warning doesn't really affect the work of bot. It tells you that application simply failed to free the unnecessary taken memory. I don't think there's any way to fix it as it depends from your system. If bot still ain't working, please send the full log, from the first line to the latest one