Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PuppeteerSharp.ProcessException: Failed to launch browser! #2593

Open
jfgreco opened this issue Apr 9, 2024 · 6 comments
Open

PuppeteerSharp.ProcessException: Failed to launch browser! #2593

jfgreco opened this issue Apr 9, 2024 · 6 comments

Comments

@jfgreco
Copy link

jfgreco commented Apr 9, 2024

Description

Trying to download and run a browser is resulting in an exception being thrown.

Code being called

using var browserFetcher = new BrowserFetcher(new BrowserFetcherOptions 
            { 
                Platform = Platform.MacOSArm64,
            });
            var revision =await browserFetcher.DownloadAsync("123.0.6312.86");
            await using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
            {
                ExecutablePath = revision.GetExecutablePath(),
                Headless = true
            });

Expected behavior:

Launch browser and connect to page

Actual behavior:

PuppeteerSharp.ProcessException: Failed to launch browser!
at PuppeteerSharp.States.ProcessStartingState.StartCoreAsync(LauncherBase p) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:line 83
at PuppeteerSharp.States.ProcessStartingState.StartCoreAsync(LauncherBase p) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:line 89
at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:line 65
at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:line 98

Versions

.Net 8.0.3
Pupeteer.Sharp - Tried 15, 15.1 & 16 all with the same result.

@kblok
Copy link
Member

kblok commented Apr 9, 2024

What’s the inner exception?

@jfgreco
Copy link
Author

jfgreco commented Apr 9, 2024

It is null:

image

@kblok
Copy link
Member

kblok commented Apr 9, 2024

It seems it’s unabled to launch the process.
Could you try running what’s in the executable path manually?
Another chance is that the download is corrupted. Would could try deleting the directory and force the download again.

@jfgreco
Copy link
Author

jfgreco commented Apr 9, 2024

It doesn't seem to be downloading correctly. I tried to override the path as well to save it somewhere else. I additionally tried to installed Chromium via brew and use that in place of downloading. It will only error no matter what I do. This code was working just the other day, that is what is puzzling.

@sdzunenko
Copy link

Have absolutely same error, running it from Azure App service (linux). Seeing that download executed correctly, but failed to run downloaded chrome itself.

PuppeteerSharp.ProcessException:
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at PuppeteerSharp.States.ProcessStartingState+<StartCoreAsync>d__6.MoveNext (PuppeteerSharp, Version=16.0.0.0, Culture=neutral, PublicKeyToken=db12f80f85d8ba23: /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:83)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at PuppeteerSharp.States.ProcessStartingState+<StartCoreAsync>d__6.MoveNext (PuppeteerSharp, Version=16.0.0.0, Culture=neutral, PublicKeyToken=db12f80f85d8ba23: /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/States/ProcessStartingState.cs:89)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at PuppeteerSharp.Launcher+<LaunchAsync>d__8.MoveNext (PuppeteerSharp, Version=16.0.0.0, Culture=neutral, PublicKeyToken=db12f80f85d8ba23: /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:66)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at PuppeteerSharp.Launcher+<LaunchAsync>d__8.MoveNext (PuppeteerSharp, Version=16.0.0.0, Culture=neutral, PublicKeyToken=db12f80f85d8ba23: /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Launcher.cs:99)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)

@jfgreco
Copy link
Author

jfgreco commented Apr 10, 2024

@kblok with confirmation of the issue from @sdzunenko any way we can get this resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants