puppeteer-sharp icon indicating copy to clipboard operation
puppeteer-sharp copied to clipboard

Timeout errors since updating to 18.0.x with Chrome V124/125

Open ezanker opened this issue 1 year ago • 9 comments

Timeout errors since updating to 18.0.x with Chrome V124/125

Description

My code runs in a .net 4.8 executable which is launched by a Windows Service running under my Windows Admin account


    Dim opts As New LaunchOptions With {
        .Headless = True
    }
    Dim browserFetcher = new BrowserFetcher
    Await browserFetcher.DownloadAsync()

    Using browser = Await Puppeteer.LaunchAsync(opts)
    ...

It hangs on the LaunchAsync line and eventually gives the timeout error below. If I tell Puppeteersharp to use Chrome Version 123, things work as normal again, but with Versions 124/125 I get the errors. Packaging and delivering Chrome 123 is not an option for me. Any Ideas?

ERROR:

System.AggregateException: One or more errors occurred. ---> System.TimeoutException: Timeout of 180000 ms exceeded
   at PuppeteerSharp.Helpers.TaskHelper.<WithTimeout>d__12`1.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Helpers/TaskHelper.cs:line 185
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.Cdp.CdpCDPSession.<SendAsync>d__13.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpCDPSession.cs:line 112
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.CDPSession.<SendAsync>d__34`1.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at PuppeteerSharp.Cdp.CdpPage.<PdfInternalAsync>d__88.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpPage.cs:line 829
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.Page.<PdfAsync>d__203.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Page.cs:line 382
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at WFS.ReportTools.VB$StateMachine_5_RenderURL.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at WFS.ReportTools._Closure$__6-0.VB$StateMachine___Lambda$__0.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at WFS.ReportTools.CreateReportGoJS_PDF_Puppeteer(String pageSize, String pageOrientation, Boolean multiPage, String mapType, String reportName, String userName, String mapDataFileName, Boolean bPackage, String PackageName)
---> (Inner Exception #0) System.TimeoutException: Timeout of 180000 ms exceeded
   at PuppeteerSharp.Helpers.TaskHelper.<WithTimeout>d__12`1.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Helpers/TaskHelper.cs:line 185
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.Cdp.CdpCDPSession.<SendAsync>d__13.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpCDPSession.cs:line 112
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.CDPSession.<SendAsync>d__34`1.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/CDPSession.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at PuppeteerSharp.Cdp.CdpPage.<PdfInternalAsync>d__88.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpPage.cs:line 829
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PuppeteerSharp.Page.<PdfAsync>d__203.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Page.cs:line 382
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at WFS.ReportTools.VB$StateMachine_5_RenderURL.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at WFS.ReportTools._Closure$__6-0.VB$StateMachine___Lambda$__0.MoveNext()

Versions

  • PuppeteerSharp 18.0.0 and 18.0.1
  • .NET framework 4.8

ezanker avatar Jun 11 '24 19:06 ezanker

Seeing the same issue here on PuppeteerSharp 18.0.1 with Chrome 125 running on NET 8 in a Windows Service. Works fine on 18.0.0 with Chrome 124, so our suspicion is that this could be related to the Windows permissions issue in https://github.com/hardkoded/puppeteer-sharp/pull/2637.

janode avatar Jun 12 '24 10:06 janode

Chrome V126 is now available but has the same errors with PuppeteerSharp 18.0.x. Interestingly, if I go back to PuppeteerSharp 10.1.0 and point at the Chrome V126 exe, it works fine with no errors... So, are there any change within Puppeteer that could solve this issue?

ezanker avatar Jun 12 '24 18:06 ezanker

Thank you for the report. I'm on vacation right now. I'll take a look at it on Monday!

kblok avatar Jun 16 '24 05:06 kblok

Just to add more information, I also ran into the Timeout issues with PuppeteerSharp 18.0.1 running on .NET 8 on a Windows IIS environment. When I reverted back to version 18.0.0 everything started working again. When running on my local development build (localhost) 18.0.1 worked fine though.

aerichmond avatar Jun 17 '24 15:06 aerichmond

@aerichmond can you try using Chrome 124?

kblok avatar Jun 17 '24 17:06 kblok

@aerichmond can you try using Chrome 124?

Yes. Specifying the Chrome 124 path does work also.

aerichmond avatar Jun 17 '24 18:06 aerichmond

@ezanker @aerichmond @janode maybe the user executing puppeteer doesn't have permissions to run this piece of code?

I tried doing something that not even the puppeteer upstream is doing. They are telling users to do this on their own.

kblok avatar Jun 17 '24 19:06 kblok

I ran the icacls command on the "..Chrome\Win64-125.0.6422.76\chrome-win64" folder but am still getting the timeout errors.

aerichmond avatar Jun 17 '24 20:06 aerichmond

Same here; running icacls is fine, but still getting timeouts when trying to printPdf.

janode avatar Jun 19 '24 07:06 janode