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

Chromium DevToolsActivePort file doesn't exist #4

Closed
LaoLittle opened this issue Dec 23, 2021 · 20 comments
Closed

Chromium DevToolsActivePort file doesn't exist #4

LaoLittle opened this issue Dec 23, 2021 · 20 comments
Assignees
Labels
bug Something isn't working

Comments

@LaoLittle
Copy link

无图形界面
已装firefox

2021-12-23 17:02:20 W/bilibili-helper: 设置主页失败
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [c1502525-2164-48fd-9645-47d527b03ca3, get {url=https://t.bilibili.com/h5/dynamic/detail/508396365455813655}]
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 95.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20211215221728, moz:debuggerAddress: localhost:51063, moz:geckodriverVersion: 0.30.0, moz:headless: true, moz:processID: 410651, moz:profile: /tmp/rust_mozprofile26M3R4, moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 5.4.0-77-generic, proxy: Proxy(), se:cdp: ws://localhost:51063/devtoo..., se:cdpVersion: 85, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: c1502525-2164-48fd-9645-47d527b03ca3
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:583)
        at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:328)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$setHome$2.invokeSuspend(BiliUtils.kt:110)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$setHome$2.invoke(BiliUtils.kt)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$setHome$2.invoke(BiliUtils.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturnIgnoreTimeout(Undispatched.kt:100)
        at kotlinx.coroutines.TimeoutKt.setupTimeout(Timeout.kt:148)
        at kotlinx.coroutines.TimeoutKt.withTimeout(Timeout.kt:44)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt.setHome(BiliUtils.kt:109)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt.setHome$default(BiliUtils.kt:108)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:85)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: io.ktor.client.features.HttpRequestTimeoutException: Request timeout has expired [url=http://localhost:36518/session/c1502525-2164-48fd-9645-47d527b03ca3/url, request_timeout=180000 ms]
        at io.ktor.client.features.HttpTimeout$Feature$install$1$invokeSuspend$$inlined$apply$lambda$1.invokeSuspend(HttpTimeout.kt:149)
        ... 6 more

2021-12-23 17:02:25 W/pixiv-helper: Pixiv Api 错误, 已忽略: io.ktor.network.sockets.ConnectTimeoutException: Connect timeout has expired [url=https://oauth.secure.pixiv.net/auth/token, connect_timeout=10000 ms]
@cssxsh cssxsh transferred this issue from cssxsh/bilibili-helper Dec 23, 2021
@cssxsh
Copy link
Owner

cssxsh commented Dec 23, 2021

可以先试试 chrome/chromium

@cssxsh cssxsh changed the title ubuntu设置主页失败 FirefoxDriver timeout Dec 23, 2021
@LaoLittle
Copy link
Author

可以先试试 chrome/chromium

好的

@LaoLittle
Copy link
Author

还有个不知道有没有影响,就是我的插件版本是mirai-selenium-plugin-1.0.3,我先更新试试

@LaoLittle
Copy link
Author

LaoLittle commented Dec 23, 2021

2021-12-23 21:56:15 W/mirai-selenium-plugin: 浏览器 Chrome 不受支持
java.lang.UnsupportedOperationException: Chrome/Chromium 版本获取失败
        at xyz.cssxsh.selenium.SeleniumInitKt.setupChromeDriver(SeleniumInit.kt:204)
        at xyz.cssxsh.selenium.SeleniumInitKt.setupWebDriver(SeleniumInit.kt:116)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.setup(MiraiSeleniumPlugin.kt:39)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.setup$default(MiraiSeleniumPlugin.kt:30)
        at xyz.cssxsh.mirai.plugin.BiliHelperPlugin$selenium$2.invoke(BiliHelperPlugin.kt:26)
        at xyz.cssxsh.mirai.plugin.BiliHelperPlugin$selenium$2.invoke(BiliHelperPlugin.kt:24)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at xyz.cssxsh.mirai.plugin.BiliHelperPlugin.getSelenium$bilibili_helper(BiliHelperPlugin.kt:24)
        at xyz.cssxsh.mirai.plugin.BiliHelperPlugin.onEnable(BiliHelperPlugin.kt:49)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:158)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:277)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:156)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:155)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:83)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
        at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
        at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
        at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
        at org.mozilla.javascript.Context.call(Context.java:554)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
        at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
        at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
        at jdk.proxy1/jdk.proxy1.$Proxy4.run(Unknown Source)
        at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:106)
        at org.itxtech.mcl.Loader.lambda$start$3(Loader.java:176)
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:145)
        at org.itxtech.mcl.Loader.start(Loader.java:176)
        at org.itxtech.mcl.Loader.main(Loader.java:68)
Caused by: java.io.IOException: Cannot run program "google-chrome": error=2, No such file or directory
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
        at xyz.cssxsh.selenium.SeleniumInitKt.setupChromeDriver(SeleniumInit.kt:190)
        ... 49 more
Caused by: java.io.IOException: error=2, No such file or directory
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
        ... 51 more

版本2.0.0

chromium应该是chromium-browser而不是google-chrome

还有个就是我的xdg-settings get default-web-browser不知为何没有输出,会导致插件一直卡住

@cssxsh
Copy link
Owner

cssxsh commented Dec 23, 2021

chromium

那你配置项改成 chromium 啊

@LaoLittle
Copy link
Author

草,我以为填Chrome自动检测是Chrome/Chromium

@LaoLittle
Copy link
Author

遇到另一个了

2021-12-24 18:27:27 E/bilibili-helper: Exception in coroutine Plugin xyz.cssxsh.mirai.plugin.bilibili-helper of bilibili-helper
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:272)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:263)
        at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:58)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:55)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)


@cssxsh
Copy link
Owner

cssxsh commented Dec 24, 2021

遇到另一个了

2021-12-24 18:27:27 E/bilibili-helper: Exception in coroutine Plugin xyz.cssxsh.mirai.plugin.bilibili-helper of bilibili-helper
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:272)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:263)
        at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:58)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:55)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

是否是在以root运行程序?

@LaoLittle
Copy link
Author

遇到另一个了

2021-12-24 18:27:27 E/bilibili-helper: Exception in coroutine Plugin xyz.cssxsh.mirai.plugin.bilibili-helper of bilibili-helper
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:272)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:263)
        at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:58)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:55)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

是否是在以root运行程序?

screen,非root

@cssxsh
Copy link
Owner

cssxsh commented Dec 24, 2021

遇到另一个了

2021-12-24 18:27:27 E/bilibili-helper: Exception in coroutine Plugin xyz.cssxsh.mirai.plugin.bilibili-helper of bilibili-helper
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:272)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:263)
        at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:58)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:55)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

是否是在以root运行程序?

screen,非root

root指的是root用户

@LaoLittle
Copy link
Author

遇到另一个了

2021-12-24 18:27:27 E/bilibili-helper: Exception in coroutine Plugin xyz.cssxsh.mirai.plugin.bilibili-helper of bilibili-helper
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: DevToolsActivePort file doesn't exist
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'VM-8-2-ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-77-generic', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (iPad; CPU OS 1...}}, pageLoadStrategy: normal}}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:272)
        at xyz.cssxsh.selenium.SeleniumInitKt$setupChromeDriver$2.invoke(SeleniumInit.kt:263)
        at xyz.cssxsh.selenium.SeleniumToolKt.RemoteWebDriver(SeleniumTool.kt:58)
        at xyz.cssxsh.mirai.plugin.MiraiSeleniumPlugin.driver(MiraiSeleniumPlugin.kt:55)
        at xyz.cssxsh.mirai.plugin.BiliUtilsKt$driver$2$driver$1.invokeSuspend(BiliUtils.kt:82)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

是否是在以root运行程序?

screen,非root

root指的是root用户

我知道,我是说非root用的screen,算是补充说明

@cssxsh
Copy link
Owner

cssxsh commented Dec 24, 2021

没能复现 DevToolsActivePort file doesn't exist ,并且就日志推测 两种浏览器都不能启动是设备性能不足导致的

@LaoLittle
Copy link
Author

没能复现 DevToolsActivePort file doesn't exist ,并且就日志推测 两种浏览器都不能启动是设备性能不足导致的

腾讯云2H4G

image

@cssxsh
Copy link
Owner

cssxsh commented Dec 25, 2021

没能复现 DevToolsActivePort file doesn't exist ,并且就日志推测 两种浏览器都不能启动是设备性能不足导致的

腾讯云2H4G

image

那就非常怪了

@cssxsh
Copy link
Owner

cssxsh commented Dec 25, 2021

有试过 2.0.0 + Firefox 吗

@LaoLittle
Copy link
Author

LaoLittle commented Dec 25, 2021

有试过 2.0.0 + Firefox 吗

暂无,之前把firefox卸掉了,我现在试试

@LaoLittle
Copy link
Author

有试过 2.0.0 + Firefox 吗

暂无,之前把firefox卸掉了,我现在试试

是没报错了,而且我的xdg-settings get default-web-browser有输出firefox.desktop
不过不知道为何无法卸载chromium ((

@cssxsh cssxsh changed the title FirefoxDriver timeout Chromium DevToolsActivePort file doesn't exist Dec 25, 2021
@cssxsh cssxsh self-assigned this Dec 26, 2021
@cssxsh cssxsh added the bug Something isn't working label Dec 26, 2021
@cssxsh cssxsh pinned this issue Dec 26, 2021
@cssxsh
Copy link
Owner

cssxsh commented Jan 15, 2022

with https://github.com/cssxsh/mirai-selenium-plugin/releases/tag/v2.0.1
自定义 arguments, 可以尝试加入 --no-sandbox, --disable-dev-shm-usage, 解决兼容性问题

@cloudlinks
Copy link

您好,我加入了arguments之后还是出现了这种请况

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: 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.)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'iZ8vb7u69g9j7k4l0tgkvnZ', ip: '172.23.70.22', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-92-generic', java.version: '11.0.13'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (Macintosh; U; ...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (Macintosh; U; ...}}, pageLoadStrategy: normal}}]

这是我的yml文件:

user_agent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50'
# 截图宽度
width: 768
# 截图高度
height: 1024
# 截图像素比
pixel_ratio: 3
# 无头模式(后台模式)
headless: true
# 代理地址
proxy: ''
# 启用日志文件
log: true
# 指定使用的浏览器,Chrome/Chromium/Firefox/Edge
browser: Chromium
# 指定使用的Factory
factory: ktor
#自定义解决兼容性问
arguments: --no-sandbox,--disable-dev-shm-usage
expires: 7

@cssxsh
Copy link
Owner

cssxsh commented Jan 18, 2022

您好,我加入了arguments之后还是出现了这种请况

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: 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.)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'iZ8vb7u69g9j7k4l0tgkvnZ', ip: '172.23.70.22', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-92-generic', java.version: '11.0.13'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (Macintosh; U; ...}}, pageLoadStrategy: normal}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--headless, --silent, --hide-scrollbars], excludeSwitches: [enable-automation, ignore-certificate-errors], extensions: [], mobileEmulation: {deviceMetrics: {height: 1024, pixelRatio: 3, width: 768}, userAgent: Mozilla/5.0 (Macintosh; U; ...}}, pageLoadStrategy: normal}}]

这是我的yml文件:

user_agent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50'
# 截图宽度
width: 768
# 截图高度
height: 1024
# 截图像素比
pixel_ratio: 3
# 无头模式(后台模式)
headless: true
# 代理地址
proxy: ''
# 启用日志文件
log: true
# 指定使用的浏览器,Chrome/Chromium/Firefox/Edge
browser: Chromium
# 指定使用的Factory
factory: ktor
#自定义解决兼容性问
arguments: --no-sandbox,--disable-dev-shm-usage
expires: 7

这个issue 太乱了,到 #8 处理

@cssxsh cssxsh closed this as completed Jan 18, 2022
@cssxsh cssxsh unpinned this issue Jan 18, 2022
@cssxsh cssxsh moved this to 👌 in Mirai Plugin Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 👌
Development

No branches or pull requests

3 participants