question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChromiumProcessException: Failed to launch Chromium!

See original GitHub issue

Description

When running the function in AWS lambda getting this exception.

{ “ClassName”: “PuppeteerSharp.ChromiumProcessException”, “Message”: "Failed to launch Chromium! “, “Data”: null, “InnerException”: null, “HelpURL”: null, “StackTraceString”: " at PuppeteerSharp.ChromiumProcess.State.StartingState.StartCoreAsync(ChromiumProcess p)\n at PuppeteerSharp.ChromiumProcess.State.StartingState.StartCoreAsync(ChromiumProcess p)\n at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options)\n at PuppeteerSharp.Launcher.LaunchAsync(LaunchOptions options)\n at ConvertorHelpers.PdfConvertor.ConvertToPdf2(String url, String fileName, String filePath) in ConvertorHelpers\PdfConvertor.cs:line 107”, “RemoteStackTraceString”: null, “RemoteStackIndex”: 0, “ExceptionMethod”: null, “HResult”: -2146233088, “Source”: “System.Private.CoreLib”, “WatsonBuckets”: null }

Complete minimal example reproducing the issue

The executable path which is formed in lambda function after fetching the browser is “/tmp/chromium/Linux-706915/chrome-linux/chrome”

E.g.

// Arrange
 var options = new LaunchOptions
                {
                    ExecutablePath = executablePath,     
                    Headless = true,
                    Devtools = false,
                    LogProcess = true,
                    Args = new[] { "--no-sandbox" }
                };

var chromiumRevision = BrowserFetcher.DefaultRevision;
  using (var browser = await Puppeteer.LaunchAsync(options)) // Exception line 107

// Act
...

// Assert
...

Expected behavior:

launch and convert HTML to PDF

Actual behavior:

Crasehs

Versions

  • Which version of PuppeteerSharp are you using? – 2.0.3
  • Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.0. – .Net core 2.1 in AWS lambda

Additional Information

Its working fine when m executing it locally i.e. on my PC(windows) but on lambda function when running on Linux getting the error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DevGenesis95commented, Jun 18, 2020

Kudos guys…finally its working …able to generate pdf from URL

image

Thanks a ton!! @brianfeucht @kblok 😃

1reaction
DevGenesis95commented, Jun 18, 2020

Yes, I can use in any way been lost from few days 😦 ok joke apart

so u want me to include these in my csproj of lambda ryt?

 <PackageReference Include="PuppeteerSharp" Version="2.0.3" />
    <PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.2.0" />
    <PackageReference Include="HeadlessChromium.Puppeteer.Lambda.Dotnet" Version="1.0.1.39" />

But just a bit confused why we including the “HeadlessChromium.Puppeteer.Lambda.Dotnet” this package if pupeetersharp doing all the stuff.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PuppeteerSharp: Failed to launch Chromium
I did upgrade google chrome manually and everything worked fine as normal. Share.
Read more >
[Ultimate PDF] Failed to launch Chromium! [0819/ ...
After investigating, it seems that the cause is that the Chromium revision being downloaded is old. I used Server Action "UseBrowser"(Module:UltimatePDF) and ...
Read more >
Use PuppeteerSharp.LaunchOptions.string in Puppeteer- ...
Learn how to set up and run automated tests with code examples of string method from our library. ... ChromiumProcessException: Failed to launch...
Read more >
Untitled
九州旅行 熊本 長崎 ChromiumProcessException: Failed to launch Chromium! #1502 Witryna10 maj 2019 · By including the puppeteer package, you automatically ...
Read more >
CentOS 7使用PuppeteerSharp无头浏览器转载
ChromiumProcessException : Failed to launch Chromium! /PuppeteerTest/PuppeteerTest/.local-chromium/Linux-706915/chrome-linux/chrome: error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found