aerokube / windows-images

Step by step instructions for building Docker images with Windows
Apache License 2.0
221 stars 44 forks source link

Error Selenoid UI : org.openqa.selenium.WebDriverException: wait: http://172.18.0.2:4444/ does not respond in 2m0s #38

Closed jacorgaz closed 3 years ago

jacorgaz commented 3 years ago

Hi,

After following and successfully created a Windows image everything works fine if running:

docker run -it --rm --privileged -p 4444:4444 -p 5900:5900 windows/edge:18

The problem comes when launching the images with Selenoid. The error that I encounter is:

org.openqa.selenium.WebDriverException: wait: http://172.18.0.2:4444/ does not respond in 2m0s

Checking Selenoid ui everything seem to be fine.

The docker-compose (I used as example different parts of the docker-compose files shown in issue 24) that I used is:

services:
  selenoid:
    container_name: test-selenoid
    image: aerokube/selenoid:1.9.3
    networks:
      - selenoid-net
    command: ["-container-network","selenoid","-service-startup-timeout","2m"]
    ports:
     - "4444:4444"
    volumes:
     - /var/run/docker.sock:/var/run/docker.sock
     - ./browsers.json:/etc/selenoid/browsers.json:ro
     - ./video:/opt/selenoid/video

  selenoid-ui: 
    container_name: test-selenoid-ui
    image: aerokube/selenoid-ui:1.9.0
    networks:
      - selenoid-net
    command:
      - "-selenoid-uri=http://selenoid:4444"
    ports:
     - "8080:8080"

networks:
  selenoid-net:

browsers.json:

{
  "MicrosoftEdge": {
    "default": "18.0",
    "versions": {
        "18.0": {
            "image": "windows/edge:18",
            "port": "4444", 
            "tmpfs": {"/tmp": "size=512m"}, 
            "path": "/"
        }
    }
  }
  }

capabilities used

 DesiredCapabilities caps = new DesiredCapabilities();
                    caps.setBrowserName("MicrosoftEdge");
                    caps.setVersion("18.0");
                    caps.setCapability("enableVNC", true);
                    caps.setCapability("enableVideo", true);
                    driver = new RemoteWebDriver(new URL("http://{DOCKER_MAHINE_IP}:4444/wd/hub"), caps);
Captura de pantalla 2020-11-12 a las 14 48 55

Screenshot_2020-11-12_15-16-14

vania-pooh commented 3 years ago

@jacorgaz take a look at browser container logs while it's running, probably something does not start.

jacorgaz commented 3 years ago

@vania-pooh I have noticed, maybe it has nothing to do with it, that in the line below the ip is not the same ip address given in the capabilities (192.168.1.110)

2020/11/12 17:11:30 [-] [NEW_REQUEST_ACCEPTED] [unknown] [192.168.1.113]

Let me know if you need anything else from my side

Selenoid container log

2020/11/12 17:10:46 [-] [INIT] [Loading configuration files...]
2020/11/12 17:10:46 [-] [INIT] [Loaded configuration from /etc/selenoid/browsers.json]
2020/11/12 17:10:46 [-] [INIT] [Video Dir: /opt/selenoid/video]
2020/11/12 17:10:46 [-] [INIT] [Your Docker API version is 1.40]
2020/11/12 17:10:46 [-] [INIT] [Timezone: UTC]
2020/11/12 17:10:46 [-] [INIT] [Listening on :4444]
2020/11/12 17:11:30 [-] [NEW_REQUEST] [unknown] [192.168.1.113]
2020/11/12 17:11:30 [-] [NEW_REQUEST_ACCEPTED] [unknown] [192.168.1.113]
2020/11/12 17:11:30 [8] [LOCATING_SERVICE] [MicrosoftEdge] [18.0]
2020/11/12 17:11:30 [8] [USING_DOCKER] [MicrosoftEdge] [18.0]
2020/11/12 17:11:30 [8] [CREATING_CONTAINER] [windows/edge:18]
2020/11/12 17:11:30 [8] [STARTING_CONTAINER] [windows/edge:18] [5aae01a57540d7cb6cb24293e82d254126fb3b0f28cb5fbdc2a4623e15566238]
2020/11/12 17:11:31 [8] [CONTAINER_STARTED] [windows/edge:18] [5aae01a57540d7cb6cb24293e82d254126fb3b0f28cb5fbdc2a4623e15566238] [0.63s]
2020/11/12 17:11:31 [8] [CREATING_VIDEO_CONTAINER] [selenoid/video-recorder:latest-release]
2020/11/12 17:11:31 [8] [STARTING_VIDEO_CONTAINER] [selenoid/video-recorder:latest-release] [13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b]
2020/11/12 17:11:32 [8] [VIDEO_CONTAINER_STARTED] [selenoid/video-recorder:latest-release] [13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b] [0.75s]
2020/11/12 17:13:32 [8] [STOPPING_VIDEO_CONTAINER] [13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b]
2020/11/12 17:13:33 [8] [REMOVING_CONTAINER] [13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b]
2020/11/12 17:13:33 [8] [FAILED_TO_REMOVE_CONTAINER] [13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b] [Error response from daemon: removal of container 13d1d453e70d5c86d9668d05a79e48c06408d1dd2583f08fcc0c0a616b39ae4b is already in progress]
2020/11/12 17:13:33 [8] [REMOVING_CONTAINER] [5aae01a57540d7cb6cb24293e82d254126fb3b0f28cb5fbdc2a4623e15566238]

Selenoid ui container logs:

2020/11/12 17:10:46 [INIT] [Listening on :8080]
2020/11/12 17:10:46 Client added. 1 registered clients
2020/11/12 17:12:05 Client added. 2 registered clients
2020/11/12 17:12:06 Removed client. 1 registered clients
2020/11/12 17:12:27 Client added. 2 registered clients
2020/11/12 17:12:28 Client added. 3 registered clients
2020/11/12 17:12:31 Removed client. 2 registered clients
2020/11/12 17:12:31 Removed client. 1 registered clients
{"state":{"total":5,"used":0,"queued":0,"pending":0,"browsers":{"MicrosoftEdge":{"18.0":{}},"chrome":{"75.0":{}},"firefox":{"60.0":{}}},"videos":null},"origin":"http://selenoid:4444","browsers":{"MicrosoftEdge":0,"chrome":0,"firefox":0},"sessions":{},"errors":[]}
vania-pooh commented 3 years ago

@jacorgaz I need browser container logs, not Selenoid \ UI logs. You can list containers during test run and output browser container with docker logs command.

jacorgaz commented 3 years ago

@vania-pooh

8c656c0a3910        windows/edge:18              "/entrypoint.sh"         About a minute ago   Up About a minute   4444/tcp, 7070/tcp, 8080/tcp, 9090/tcp   trusting_pare

Waiting xvfb...

 --- x11vnc loop: 1 ---

 --- x11vnc loop: waiting for: 30

PORT=5900
jacorgaz commented 3 years ago

With edge latest images it works.