aerokube / cm

Configuration manager for Aerokube products
https://aerokube.com/cm/latest/
Apache License 2.0
119 stars 31 forks source link

Can't create Selenoid session #323

Closed IlyaMaliauka closed 1 year ago

IlyaMaliauka commented 1 year ago

Hi team,

For some reason, for several days I'm not able to create neither automated nor manual selenoid sessions. When I try to create session manually by pressing "create session" on selenod-ui, nothing happens, even though SSE and Selenoid indicators are green.

When I try to launch session automatically, the output of build context is the following:

[+] Building 0.6s (9/9) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 452B                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/browsers/edge:109.0                                                                                                                                                                          0.0s
 => [1/4] FROM docker.io/browsers/edge:109.0                                                                                                                                                                                            0.1s
 => [internal] load build context                                                                                                                                                                                                       0.0s
 => => transferring context: 64B                                                                                                                                                                                                        0.0s
 => [2/4] COPY Certificate.pfx .                                                                                                                                                                                                           0.1s
 => [3/4] COPY policy.json /etc/opt/edge/policies/managed/policy.json                                                                                                                                                                   0.0s
 => [4/4] RUN mkdir -p $HOME/.pki/nssdb && certutil -T -d sql:$HOME/.pki/nssdb && certutil -N -d sql:$HOME/.pki/nssdb --empty-password && pk12util -i Certificate.pfx -d sql:$HOME/.pki/nssdb -W ${MY_CERT_PASS}                               0.3s
 => exporting to image                                                                                                                                                                                                                  0.1s
 => => exporting layers                                                                                                                                                                                                                 0.1s
 => => writing image sha256:1b101b3b9e03647d34627c449d0701f508cda9c7a01b733d32a532e0c0359434                                                                                                                                            0.0s
 => => naming to docker.io/browsers/edge:109.0           

I get the following error when trying to connect

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Unable to parse remote response: You are using Selenoid 1.10.10! 
Host info: host: '${my.host.name}', ip: '${my.ip}'

    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:134)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
    at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:51)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
    at autotests.framework.driver.driverfactory.RemoteWebDriverFactory.create(RemoteWebDriverFactory.java:35)
    at autotests.framework.driver.driverfactory.SeleniumDriverManager.getDriver(SeleniumDriverManager.java:38)
    at autotests.framework.driver.Browser.getWebDriver(Browser.java:86)
    at autotests.framework.utils.DelayHelper.setTimeOutsToDefault(DelayHelper.java:35)
    at autotests.framework.utils.DelayHelper.setTimeOutsToDefault(DelayHelper.java:48)
    at autotests.framework.driver.Browser.initBrowser(Browser.java:117)
    at autotests.framework.utils.LoginUtils.loginWithSelenoid(LoginUtils.java:86)
    at autotests.framework.utils.LoginUtils.login(LoginUtils.java:37)
    at autotests.apps.sapedia.test.BaseSteps.setUp(BaseSteps.java:77)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
    at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69)
    at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:361)
    at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:296)
    at org.testng.internal.invokers.TestInvoker.runConfigMethods(TestInvoker.java:816)
    at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:590)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:221)
    at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
    at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:962)
    at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:194)
    at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
    at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.testng.TestRunner.privateRun(TestRunner.java:806)
    at org.testng.TestRunner.run(TestRunner.java:601)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:433)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:427)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:387)
    at org.testng.SuiteRunner.run(SuiteRunner.java:330)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1256)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1176)
    at org.testng.TestNG.runSuites(TestNG.java:1099)
    at org.testng.TestNG.run(TestNG.java:1067)
    at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
    at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)
Caused by: org.openqa.selenium.json.JsonException: Unable to parse: You are using Selenoid 1.10.10!
    at org.openqa.selenium.json.Json.toType(Json.java:57)
    at org.openqa.selenium.json.Json.toType(Json.java:50)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:131)
    ... 48 more
Caused by: org.openqa.selenium.json.JsonException: Unable to determine type from: Y. Last 1 characters read: Y
Build info: version: '4.8.0', revision: '267030adea'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.16'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:126)
    at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:141)
    at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:127)
    at org.openqa.selenium.json.Json.toType(Json.java:71)
    at org.openqa.selenium.json.Json.toType(Json.java:55)
    ... 50 more

I'm sure that all the settings are correst as I have other Linux VM on Ubuntu 18.04 and it's working fine.

Selenoid version: 1.10.0 Docker API version: 1.41 Ubuntu version: 20.04 Java version: 11.0.16

Already tried reinstalling docker/Configuration Manager/selenoid/selenoid-ui - no luck

Are there any suggestions?

IlyaMaliauka commented 1 year ago

UPD: Just realized that the problem is in Docker version. It works fine on 20.10.17, but doesn't work on 23.0.1 (latest ver.). Can the latest selenoid versions be incompatible with the latest Docker version?

vania-pooh commented 1 year ago

@IlyaMaliauka if you think that this is Docker version related stuff, then take a look at latest release: https://github.com/aerokube/selenoid/releases/tag/1.10.10

IlyaMaliauka commented 1 year ago

@IlyaMaliauka if you think that this is Docker version related stuff, then take a look at latest release: https://github.com/aerokube/selenoid/releases/tag/1.10.10

Btw configuration manager output is: Did not manage to determine your Docker API version - using default version: 1.41 However, obviously Docker v.23.0.1 uses Docker API 1.42.

@vania-pooh I've tried using: docker run -e DOCKER_API_VERSION=1.42 -d --name selenoid -p 4444:4444 -v /etc/selenoid:/etc/selenoid:ro -v /var/run/docker.sock:/var/run/docker.sock aerokube/selenoid:latest-release - no luck, cm still states that my Docker API version is 1.41

Any reason behind that?

vania-pooh commented 1 year ago

@IlyaMaliauka need to update Docker client in CM too.