Discussion:
[selenium-users] Why is chrome browser not launching from Linux Root User?
Poovaraj Thangamariappan
2018-11-18 16:34:48 UTC
Permalink
Hi All,


I am executing selenium script in Linux machine with chrome browser
headless mode. Chrome browser is launching successfully in normal user but
it is not lunching when I am running from Linux root user. Please help me
to fix this issue.



*Chrome browser version:69*

*ChromeDriver 2.43.600233*



*Desire capability Settings:-*



ChromeOptions options = *new* ChromeOptions();

options.addArguments("--start-maximized");

options.addArguments("disable-infobars");

options.addArguments("--headless");

options.addArguments("--disable-gpu");



Map<String, Object> prefs = *new* HashMap*<String, Object>*();

prefs.put("profile.default_content_settings.popups",
0); prefs.put(
"profile.default_content_setting_values.automatic_downloads", 1);

prefs.put("download.prompt_for_download", *false*);

options.setExperimentalOption("prefs", prefs);

capabilities = DesiredCapabilities.*chrome*();

capabilities.setCapability(ChromeOptions.*CAPABILITY*, options);

capabilities.setCapability("platform", "LINUX");

capabilities.setJavascriptEnabled(true);



*Normal User (Working fine):-*



S[1542555709.360][tartiSEVERE]:ng ChromeDriver 2.43.600233
(523efee95e3d68b8719b3a1c83051aa63aa6b10d) on port 21713

Only locabind() returned an error, errno=0: Cannot assign requested
address (99)

l connections are allowed.

log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.

Nov 18, 2018 4:41:49 PM org.openqa.selenium.remote.ProtocolHandshake
createSession

INFO: Detected dialect: OSS





*Error Message Root User:-*



S[15425tarting C56289.418][SEVERE]: bind() returned an ehromeDriver rror,
errno=2.43.600233 0: Cannot assign requested address(523ef (99)

ee95e3d68b8719b3a1c83051aa63aa6b10d) on port 32218

Only local connections are allowed.

log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.

Exception in thread "pool-1-thread-1"
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to
start: exited abnormally

(unknown error: 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.)

(Driver info: chromedriver=2.43.600233
(523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux
3.10.0-693.17.1.el7.x86_64 x86_64) (WARNING: The server did not provide any
stacktrace information)

Command duration or timeout: 113 milliseconds

Build info: version: '2.42.2', revision:
'6a6995d31c7c56c340d65f45a76976d4350u6cd6ccmmmm', time: '2014-06-03
10:52:47'

System info: host: 'hhhhhhhhhhhh', ip: '00.00.00.00', os.name: 'Linux',
os.arch: 'amd64', os.version: '3.10.0-693.17.1.el7.x86_64', java.version:
'1.8.0_181'

Driver info: driver.version: ChromeDriver

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)

at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)

at
org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)

at
org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)

at
org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365)

at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

at
java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)

at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)

at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)

at
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)

at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)

at
java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)

at
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at
java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)

at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)

at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)

at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)

at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)

at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)

at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)

at
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)

at
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148)

at
--
Regards,
Poovaraj
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAMu9-ZW4D4vmB4s2JEK_JQObB%2BVczV3s2ZCYF76ScucaVTM2-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Priyanka Das
2018-11-18 18:46:44 UTC
Permalink
I was also facing same issue before.
Do one thing:
1- Delete that chrome driver reinstall the compatible chrome driver.
2- check the ownership of your project and also your chrome driver. Both
ownership should be "root" as you want to execute
3- set one display port where you need to initialize the browser.


Then check, hope your issue will resolve.


Thanks,

On Sun, Nov 18, 2018, 10:05 PM Poovaraj Thangamariappan <
Post by Poovaraj Thangamariappan
Hi All,
I am executing selenium script in Linux machine with chrome browser
headless mode. Chrome browser is launching successfully in normal user but
it is not lunching when I am running from Linux root user. Please help me
to fix this issue.
*Chrome browser version:69*
*ChromeDriver 2.43.600233*
*Desire capability Settings:-*
ChromeOptions options = *new* ChromeOptions();
options.addArguments("--start-maximized");
options.addArguments("disable-infobars");
options.addArguments("--headless");
options.addArguments("--disable-gpu");
Map<String, Object> prefs = *new* HashMap*<String, Object>*();
prefs.put("profile.default_content_settings.popups",
0); prefs.put(
"profile.default_content_setting_values.automatic_downloads", 1);
prefs.put("download.prompt_for_download", *false*);
options.setExperimentalOption("prefs", prefs);
capabilities = DesiredCapabilities.*chrome*();
capabilities.setCapability(ChromeOptions.*CAPABILITY*, options);
capabilities.setCapability("platform", "LINUX");
capabilities.setJavascriptEnabled(true);
*Normal User (Working fine):-*
S[1542555709.360][tartiSEVERE]:ng ChromeDriver 2.43.600233
(523efee95e3d68b8719b3a1c83051aa63aa6b10d) on port 21713
Only locabind() returned an error, errno=0: Cannot assign requested
address (99)
l connections are allowed.
log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Nov 18, 2018 4:41:49 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
*Error Message Root User:-*
S[15425tarting C56289.418][SEVERE]: bind() returned an ehromeDriver rror,
errno=2.43.600233 0: Cannot assign requested address(523ef (99)
ee95e3d68b8719b3a1c83051aa63aa6b10d) on port 32218
Only local connections are allowed.
log4j:WARN No appenders could be found for logger
(org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Exception in thread "pool-1-thread-1"
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to
start: exited abnormally
(unknown error: 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.)
(Driver info: chromedriver=2.43.600233
(523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux
3.10.0-693.17.1.el7.x86_64 x86_64) (WARNING: The server did not provide any
stacktrace information)
Command duration or timeout: 113 milliseconds
'6a6995d31c7c56c340d65f45a76976d4350u6cd6ccmmmm', time: '2014-06-03
10:52:47'
System info: host: 'hhhhhhhhhhhh', ip: '00.00.00.00', os.name: 'Linux',
'1.8.0_181'
Driver info: driver.version: ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at
org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at
org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at
org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365)
at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at
java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at
java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at
java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)
at
org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
at
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)
at
org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148)
at
--
Regards,
Poovaraj
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/CAMu9-ZW4D4vmB4s2JEK_JQObB%2BVczV3s2ZCYF76ScucaVTM2-g%40mail.gmail.com
<https://groups.google.com/d/msgid/selenium-users/CAMu9-ZW4D4vmB4s2JEK_JQObB%2BVczV3s2ZCYF76ScucaVTM2-g%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAAuoDqM0QMP4o9evu3WWG5N8r9Hwy7S9Xrxqt2e6FkBTTKsAuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...