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

[🐛 Bug]: Issue while deploying the same on Ubuntu 22.04 LTS with C# with .NET8 #14391

Closed
PKYADAV opened this issue Aug 14, 2024 · 5 comments
Closed
Labels
I-question Applied to questions. Issues should be closed and send the user to community resources.

Comments

@PKYADAV
Copy link

PKYADAV commented Aug 14, 2024

What happened?

We have developed web scraping tool to post data in application that will be opened in chrome browser. We are able to run smoothly on windows. While running the same on Ubuntu 22.04 LTS, below is the case:

  1. While running through VS Code in debug mode it's working fine.
  2. When we publish it and deploy the same in systemd service then it's showing below exception:

Starting ChromeDriver 127.0.6533.99 (f31af5097d90ef5ae5bd7b8700199bc6189ba34d-refs/branch-heads/6533@{#1910}) on port 42457 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. [13:22:02 ERR] session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (SessionNotCreated) System.InvalidOperationException: session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (SessionNotCreated) at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute) at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities) at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities) at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)

Please note, I am able to run with headless options but we required to user interaction before proceeding for operation due to security reasons.

How can we reproduce the issue?

using IWebDriver driver = new ChromeDriver();
    var webUrl = "https://test.automation.com/";
    Console.WriteLine("Waiting 15 Seconds for Warmup !!");
    await Task.Delay(15000);
    Console.WriteLine($"Opening Url:{webUrl} !!");
    driver.Navigate().GoToUrl(webUrl); // link is the target url
    
    var name = driver.FindElement(By.Id("name"));
    var email = driver.FindElement(By.Id("email"));
    var mobile = driver.FindElement(By.Id("mobile"));
    var company = driver.FindElement(By.Id("company"));
    var notes = driver.FindElement(By.Id("message"));

    name.SendKeys("Pravin Yadav");
    email.SendKeys("pravin.yadav@nidoworld.com");
    mobile.SendKeys("123456784654");
    company.SendKeys("NIDO Machineries Private Limited");
    notes.SendKeys("Test Message from Web Scraping");

Relevant log output

Starting ChromeDriver 127.0.6533.99 (f31af5097d90ef5ae5bd7b8700199bc6189ba34d-refs/branch-heads/6533@{#1910}) on port 42457
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[13:22:02 ERR] session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (SessionNotCreated)
System.InvalidOperationException: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (SessionNotCreated)
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.ExecuteAsync(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)

Operating System

Ubuntu 22.04 LTS

Selenium version

4.23.0 with C# with .NET 8

What are the browser(s) and version(s) where you see this issue?

Chrome 127.0.6533.99

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 127.0.6533.11900

Are you using Selenium Grid?

No response

Copy link

@PKYADAV, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Aug 15, 2024

Use something like Xvfb to run on machines without an actual screen.

@diemol diemol added I-question Applied to questions. Issues should be closed and send the user to community resources. and removed I-defect needs-triaging labels Aug 15, 2024
Copy link

💬 Please ask questions at:

@PKYADAV
Copy link
Author

PKYADAV commented Aug 15, 2024

Use something like Xvfb to run on machines without an actual screen.

There is authentication screen as well and user interaction is required, so we can't run in headless mode.

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I-question Applied to questions. Issues should be closed and send the user to community resources.
Projects
None yet
Development

No branches or pull requests

2 participants