3

The error started to happen after updating google chrome to the latest version: 89.0.4389.82 (Official Build) (64-bit). OS: Windows 10

Error:

PuppeteerSharp.ChromiumProcessException: 
Failed to launch Chromium! [0309/160320.924:ERROR:os_crypt_win.cc(70)] Failed to encrypt: The system cannot find the file specified. (0x2)

Help, please!

  • Fixed using Chromium instead of Chrome – Yanosky Rios La Hoz Mar 11 '21 at 20:25
  • Please explain what you did to fix it. How do you "use Chromium instead of Chrome". I thought PuppeteerSharp was using Chromium already. – Steve Schmitt May 04 '21 at 18:25
  • you can specify the executable path of 'Chromium' or 'Chrome' ``` var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, ExecutablePath = chromiumExecPath }); ``` – Yanosky Rios La Hoz May 05 '21 at 23:45
  • Thanks! Yes, ExecutablePath was the answer. I thought that I didn't need to specify it because I was using BrowserFetcher.DownloadAsync("851527"). But I needed ExecutablePath, because I specified a particular version to download (not the default), and it goes to a separate directory. – Steve Schmitt May 06 '21 at 04:37

2 Answers2

1

I too got the same error while launching the chrome in the server using an application. I did upgrade google chrome manually and everything worked fine as normal.

vidya
  • 69
  • 5
0

after much faffing around trying to get this working in an asp.net app running in a production server environment (windows server 2019 in azure VM), i wanted to elaborate on vidya's answer "upgrade google chrome manually":

set the version number manually based on the latest version on this URL: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/

in my case that version is 890410. set your code to use this version instead of DefaultChromiumRevision

const string ChromiumRevision = "890410";
var options = new BrowserFetcherOptions();
options.Path = HttpContext.Current.Server.MapPath("/App_Data");
var bf = new BrowserFetcher(options);
await bf.DownloadAsync(ChromiumRevision);   
string exePath = bf.GetExecutablePath(ChromiumRevision); 
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
   Headless = true,
   ExecutablePath = exePath,
   Args = new string[]{"--disable-gpu","--no-sandbox"}
}); 
Tim_Mac
  • 145
  • 1
  • 7