4

I'm running some selenium c# chrome driver test with the latest version of chrome driver and chrome.

On my desktop Windows 10 PC it works fine, however, in production Windows server 2016 I'm getting this error when selenium tries to start a new process.

[0703/113439.645:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
[0703/113439.647:ERROR:exception_snapshot_win.cc(88)] thread ID 21028 not found in process 

I've posted here on ServerFault rather than StackOverflow because

A process has requested access to an object, but has not been granted those access rights

Seems to be a common error other applications have. I'm fairly certain its a permission error, however..

I'm logged in as local administrator and I'm running my c# app that spaws the other processes ChromeDriver and Chrome as local administrator.

I've also set the everyone permission to full access on the applications folder.

What else can I do to allow my app, chrome, and chrome driver more access rights?

Mr J
  • 141
  • 1
  • 2
  • 5
  • 1
    Is your Windows server 2016 up to date ? You should try to monitor this issue with [Procmon](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) and see what you can get from it. – Swisstone Jul 11 '18 at 21:22
  • IIRC, one common cause of 0xc0000022 when launching a process is that the process doesn't have sufficient access to the window station and/or desktop it is trying to run on. Do you know what security context selenium is trying to use to launch the process? Is it trying to run it interactively (i.e., on your desktop, so that you would see it) or non-interactively? Is selenium running in your logon session or is it a system service? – Harry Johnston Jul 12 '18 at 21:57

1 Answers1

0

This error message...

[0703/113439.645:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
[0703/113439.647:ERROR:exception_snapshot_win.cc(88)] thread ID 21028 not found in process

...implies that the ChromeDriver initiated thread was unable to read the system resource as access was denied.


Root Cause

A common cause for Access Denied is running Chrome as root user (administrator) on Linux. While it is possible to work around this issue by passing --no-sandbox flag when creating your WebDriver session, such a configuration is unsupported and highly discouraged. You need to configure your environment to run Chrome as a regular user instead.


Additional Consideration

Ensure that:

  • Selenium is upgraded to current released Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v84.0 level.
  • Chrome is updated to current Chrome Version 84.0 level. (as per ChromeDriver v84.0 release notes)
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

tl; dr

ChromeDriver - WebDriver for Chrome