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
110 stars 48 forks source link

Puppeteer session closed error #33

Open GapiCer opened 3 months ago

GapiCer commented 3 months ago

I've been having a lot of issues getting puppeteer to work properly. Before, I was running on an arm cpu, but now I got a new vm running amd64, and I still get "Failed to launch browser" (though with a different error code). I'm pretty sure I installed all the dependencies, I had to add a line to sources.list do install them properly. I'm sorry if this is a dumb question, but I'd appreciate if someone could help me with this. Here's the full error:

Failed to launch browser
Exception details:
PuppeteerSharp.TargetClosedException: Protocol error (Performance.enable): Session closed. Most likely the Page has been closed.Close reason: The remote party closed the WebSocket connection without completing the close handshake. (The remote party closed the WebSocket connection without completing the close handshake.)
   at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 79
   at PuppeteerSharp.Page.InitializeAsync() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Page.cs:line 1221
   at PuppeteerSharp.Page.CreateAsync(CDPSession client, Target target, Boolean ignoreHTTPSErrors, ViewPortOptions defaultViewPort, TaskQueue screenshotTaskQueue) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Page.cs:line 1128
   at PuppeteerSharp.Page.CreateAsync(CDPSession client, Target target, Boolean ignoreHTTPSErrors, ViewPortOptions defaultViewPort, TaskQueue screenshotTaskQueue) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Page.cs:line 1140
   at PuppeteerSharp.PageTarget.PageAsync() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/PageTarget.cs:line 42
   at PuppeteerSharp.BrowserContext.PagesAsync() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/BrowserContext.cs:line 54
   at PuppeteerSharp.Browser.PagesAsync() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Browser.cs:line 179
   at PuppeteerExtraSharp.PuppeteerExtra.Register(IBrowser browser)
   at PuppeteerExtraSharp.PuppeteerExtra.OnStart(BrowserStartContext context, IBrowser browser)
   at PuppeteerExtraSharp.PuppeteerExtra.LaunchAsync(LaunchOptions options)
   at PuppeteerLib.WebDriverClient.LaunchBrowserInstanceAsync(String path) in C:\Users\username\GitHub\PuppeteerRestClient\WebDriverClient.cs:line 45
[2024-08-27 13:26:05Z] System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CharacterAiNetApiWrapper.CaiClient.ConnectAsync() in C:\Users\username\GitHub\CharacterAI-NET-API-Wrapper\src\CaiClient.cs:line 40
   at CharacterEngineDiscord.Services.IntegrationsService.LaunchCaiAsync() in /home/gapi/dbot/c-engine/Services/IntegrationsService.cs:line 97
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at CharacterEngineDiscord.Services.IntegrationsService.Initialize() in /home/gapi/dbot/c-engine/Services/IntegrationsService.cs:line 86
   at CharacterEngineDiscord.Services.BotService.SetupIntegration() in /home/gapi/dbot/c-engine/Services/BotService.cs:line 255

Running Ubuntu 24.04.1 LTS