1

I am trying to run google chrome from my linux console but i face this error that stops me

[1210/075921.073808:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No 
such file or directory (2)
[1210/075921.074075:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No 
such file or directory (2)
Trace/breakpoint trap (core dumped)

I am trying to launch this since when i launch my Selenium shell file i get this error:

org.openqa.selenium.SessionNotCreatedException: Could not start a new
 session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assu
ming that Chrome has crashed.)

Do i need to downgrade the version of my google chrome ?

Version

Google-chrome V 96

ChromeDriver V 96 i downloaded the linux chromedriver

My chrome launching code :

@BeforeTest
    public void LaunchWebsite() throws IOException {
        File ScreenShots = new File(System.getProperty("user.dir") + "/" + "test-output/ScreenShots");
        if(ScreenShots.mkdir()) {
            System.out.println("The File Screen shot was created successfully");
        }
        // Launch Chrome
        String path = System.getProperty("user.dir");
        //System.setProperty("webdriver.chrome.driver", path+"/Driver/chromedriver.exe");
        System.setProperty("webdriver.chrome.driver", path+"/Driver/chromedriver");
        driver = new ChromeDriver();
        // Acces Website
        driver.get("");
        driver.manage().window().maximize();
        Base b = new Base(driver);
        Reporter.log(FormatMessageSucces + " Chrome is Opened</font>");
    }
Yan
  • 108
  • 1
  • 8
  • Please share your code – Prophet Dec 10 '21 at 08:16
  • @Prophet it's done if you wanna check – Yan Dec 10 '21 at 08:19
  • I think this is an open issue: https://stackoverflow.com/q/70069412/7365461. It happened to me when using WSL2 and Chrome 96. For people using WSL2 and having this problem, doing method 2 here fixed it for me: https://stackoverflow.com/questions/58205600/cannot-start-chromeheadless-in-angular-project-using-wsl-works-on-mac/67301905#67301905. – AliF50 Jan 05 '22 at 14:07
  • Recently Chrome version 97 was released and with Chrome 97 it seems to be back to normal. – AliF50 Jan 06 '22 at 16:07
  • @Yan - issue still exist in chrome-98 also. I'm trying to run chrome in ubuntu-docker image, getting this error. This error isn't happening till chrome-94 though. Did you find any solution? – human Feb 22 '22 at 09:42
  • This just started happening to me as well, on Fedora with both `google-chrome-stable` and `-unstable` from Google repos. The only solution I've found so far is to run them under `strace -f`. That prevents the crashing, which is obviously from a subprocess as `strace` without the `-f` doesn't work. – FeRD Mar 07 '22 at 23:02
  • Even more curious, I've just now discovered that in addition to `strace -f google-chrome-stable` working, _this_ also works: `sudo -u ferd google-chrome-stable`! I have no explanation why running Chrome **`sudo`'d as my _own_ user account** would fix these startup crashes, but now I'm even more annoyed by them. – FeRD Mar 24 '22 at 01:34

0 Answers0