SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.77k stars 8.02k forks source link

[🐛 Bug]: ssh ssh start java error , No problem with non-ssh startup #14075

Closed poo0054 closed 4 weeks ago

poo0054 commented 4 weeks ago

What happened?

I started java on the desktop and successfully opened and executed it. However, when I started sh in ssh or other methods, there was no problem starting java, but every time I opened the browser, I would get an error.

I am using almalinux, and when I start my ssh on the remote desktop, everything works fine. But when I start it in ssh, the following error appears.

My command is:

/data/jdk1.8.0_401/bin/java -Xmx2g -Xms2g -XX:+HeapDumpOnOutOfMemoryError \ -XX:HeapDumpPath=/data/project/logs/heapDump.hprof \ -jar /data/project/ylos-bot-robot.jar \ --spring.config.location=/data/project/config/application.yml,/data/project/config/application-prod.yml \ --logging.config=/data/project/config/logback-spring.xml \ --spring.profiles.active=prod

I have tried nohup, system, sh to start directly,But this problem occurred.

Is this a problem with my operation or a bug? Is there anything else I can do?

This should not be related to the version. I use the same account on the desktop and ssh, so I don't think it matters.

I saw someone mentioned using supervisorctl, I tried that too, same problem. Is there anything else I can do?

But if I add this sentence, there is no problem. But I can't see the browser open on my Linux desktop. Is there any way to open the browser on the desktop

options.addArguments("disable-infobars");

How can we reproduce the issue?


Use the same account in ssh and start the Java program, no matter what version, and then open the browser and an error will be reported. If you open it on the desktop, there will be no such problem.

Relevant log output

session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'robot01', ip: '192.168.1.118', os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-427.18.1.el9_4.x86_64', java.version: '1.8.0_401'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x55942b386e3a <unknown>
#1 0x55942b07045c <unknown>
#2 0x55942b0a56f8 <unknown>
#3 0x55942b0a163b <unknown>
#4 0x55942b0ebb19 <unknown>
#5 0x55942b0df253 <unknown>
#6 0x55942b0af1c7 <unknown>
#7 0x55942b0afb3e <unknown>
#8 0x55942b34d27b <unknown>
#9 0x55942b351327 <unknown>
#10 0x55942b339dae <unknown>
#11 0x55942b351df2 <unknown>
#12 0x55942b31e74f <unknown>
#13 0x55942b376128 <unknown>
#14 0x55942b3762fb <unknown>
#15 0x55942b385f6c <unknown>
#16 0x7f802ce89c02 start_thread

org.openqa.selenium.SessionNotCreatedException: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'robot01', ip: '192.168.1.118', os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-427.18.1.el9_4.x86_64', java.version: '1.8.0_401'
Driver info: driver.version: ChromeDriver
remote stacktrace: #0 0x55942b386e3a <unknown>
#1 0x55942b07045c <unknown>
#2 0x55942b0a56f8 <unknown>
#3 0x55942b0a163b <unknown>
#4 0x55942b0ebb19 <unknown>
#5 0x55942b0df253 <unknown>
#6 0x55942b0af1c7 <unknown>
#7 0x55942b0afb3e <unknown>
#8 0x55942b34d27b <unknown>
#9 0x55942b351327 <unknown>
#10 0x55942b339dae <unknown>
#11 0x55942b351df2 <unknown>
#12 0x55942b31e74f <unknown>
#13 0x55942b376128 <unknown>
#14 0x55942b3762fb <unknown>
#15 0x55942b385f6c <unknown>
#16 0x7f802ce89c02 start_thread

    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.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57)
    at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:122)
    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:499)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    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:125)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:157)
    at com.ylos.bot.robot.service.AbstractRobotProcessService.genChromeDriver(AbstractRobotProcessService.java:127)
    at com.ylos.bot.robot.service.AbstractRobotProcessService.genWebDriverByName(AbstractRobotProcessService.java:89)
    at com.ylos.bot.robot.service.AbstractRobotProcessService.genWebDriver(AbstractRobotProcessService.java:76)
    at com.ylos.bot.robot.service.robot.xbps.XbpsPalletOnShelfRobotProcessServiceImpl.bulkExecute(XbpsPalletOnShelfRobotProcessServiceImpl.java:74)
    at com.ylos.bot.robot.service.impl.DwsRobotActTaskServiceImpl.callTabRobotActTaskByTasks(DwsRobotActTaskServiceImpl.java:255)
    at com.ylos.bot.robot.service.impl.DwsRobotActTaskServiceImpl.doRedisQueryRobotActTask(DwsRobotActTaskServiceImpl.java:332)
    at com.ylos.bot.robot.service.impl.DwsRobotActTaskServiceImpl.doScheduleRobotActTask(DwsRobotActTaskServiceImpl.java:275)
    at com.ylos.bot.robot.service.impl.DwsRobotActTaskServiceImpl$$FastClassBySpringCGLIB$$9fd58188.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
    at com.ylos.bot.robot.service.impl.DwsRobotActTaskServiceImpl$$EnhancerBySpringCGLIB$$52e6b0b.doScheduleRobotActTask(<generated>)
    at com.ylos.bot.robot.service.robot.SmartCommonService.callScheduleRobotActTask(SmartCommonService.java:33)
    at com.ylos.bot.robot.service.robot.task.AbstractBaseAutoTask.callGenericRobotTasks(AbstractBaseAutoTask.java:163)
    at com.ylos.bot.robot.service.robot.task.AbstractBaseAutoTask.doTask(AbstractBaseAutoTask.java:93)
    at com.ylos.bot.robot.service.robot.task.AbstractBaseAutoTask.lambda$multiDoTask$0(AbstractBaseAutoTask.java:82)
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
    at org.springframework.cloud.sleuth.instrument.async.TraceRunnable.run(TraceRunnable.java:68)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)

Operating System

almalinux

Selenium version

java

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

no

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

no

Are you using Selenium Grid?

No response

github-actions[bot] commented 4 weeks ago

@poo0054, 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!

titusfortner commented 4 weeks ago

Duplicate #12841 See chrome bug report in that issue