aerokube / cm

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

Windows 10. Video is not recorded when Docker Uses the WSL 2 based engine #293

Open SergeyShidlovsky opened 3 years ago

SergeyShidlovsky commented 3 years ago

Precondition

Expected result

Actual result

Workaround

vania-pooh commented 3 years ago

@SergeyShidlovsky video recorder container logs could help to diagnose. We unfortunately don't have Windows available.

ArysX commented 3 years ago

I have the same problem, after disable WSL 2 in docker settings Video recorded works fine.

Logs from container with WSL 2 enabled: 2021/03/03 10:48:04 [17] [VIDEO_ERROR] [Failed to rename /opt/selenoid/video/selenoide9e31f300553f1729bce65fa19dfe109.mp4 to /opt/selenoid/video/Test_Scenario.mp4: rename /opt/selenoid/video/selenoide9e31f300553f1729bce65fa19dfe109.mp4 /opt/selenoid/video/Test_Scenario.mp4: no such file or directory]

vania-pooh commented 3 years ago

@ArysX @SergeyShidlovsky are you installing Selenoid with CM tool?

SergeyShidlovsky commented 3 years ago

@vania-pooh , I apologize for such a late response,

@ArysX @SergeyShidlovsky are you installing Selenoid with CM tool?

Yes, I had installed selenoid using configuration management, Also, I have launched selenoid using the command 'cm.exe selenoid start --vnc'

@ArysX, thanks for the logs

mvishnevsky commented 3 years ago

Have the same issue using docker-compose, videos are not saved.

vania-pooh commented 3 years ago

Seems to be a CM bug. Will investigate.

SergeyShidlovsky commented 2 years ago

@vania-pooh Any updates with this bug?

benzman81 commented 2 years ago

Just moved from vagrant and virtualbox to WSL 2. Same error. We use WSL 2 with Rancher Desktop.

vania-pooh commented 2 years ago

We plan to completely deprecate this tool and move to raw Docker commands instead. Too many weird cases to cover.

benzman81 commented 2 years ago

@vania-pooh ok, thanks. We now moved to plain docker and videos work as expected.

SergeyShidlovsky commented 1 year ago

@vania-pooh … are you talking about deprecation of Selenoid Configuration Manager Tool?

vania-pooh commented 1 year ago

@SergeyShidlovsky we are considering this.

Lucifar2 commented 8 months ago

@benzman81 Hi, could you help me to setup selenoid with Rancher desktop. Currently I am facing issue for selenoid container being in Restarting status. Do you know if you faced this same issue ?

benzman81 commented 8 months ago

@benzman81 Hi, could you help me to setup selenoid with Rancher desktop. Currently I am facing issue for selenoid container being in Restarting status. Do you know if you faced this same issue ?

I can share parts of our start script we use for rancher desktop in wsl. Maybe that helps:

#!/bin/bash

windowsUserFolder=$(wslpath "$(wslvar USERPROFILE)")
aerokubeFolder=$windowsUserFolder/.aerokube
mkdir -p $aerokubeFolder || true
mkdir -p $aerokubeFolder/selenoid || true
mkdir -p $aerokubeFolder/selenoid/config || true
mkdir -p $aerokubeFolder/selenoid/video || true
mkdir -p $aerokubeFolder/selenoid/logs || true
mkdir -p $aerokubeFolder/selenoid-ui || true

docker rm -f selenoid || true
docker rm -f selenoid-ui || true
find $aerokubeFolder/selenoid/video -mindepth 1 -maxdepth 1 -mmin +120 -name '*.mp4' | xargs rm -rf || true
find $aerokubeFolder/selenoid/logs -mindepth 1 -maxdepth 1 -mmin +120 -name '*.log' | xargs rm -rf || true

cd /home/$USER

cd /home/$USER/selenium-grid-ggr-dockerselenoid

rm $aerokubeFolder/selenoid/config/browsers.json || true

cp /YOUR_PATH_TO_BROWSERS_JSON/browsers.json $aerokubeFolder/selenoid/config/browsers.json

cat $aerokubeFolder/selenoid/config/browsers.json | /home/$USER/jq 'map(.versions)|.[]|map(.image)|.[]' | xargs -L1 docker pull

docker pull selenoid/video-recorder:latest-release

cd /home/$USER

docker run -d --name selenoid --restart=always -p 4444:4444 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $aerokubeFolder/selenoid/config/:/etc/selenoid/:ro \
-v $aerokubeFolder/selenoid/video/:/opt/selenoid/video/ \
-v $aerokubeFolder/selenoid/logs/:/opt/selenoid/logs/ \
-e OVERRIDE_VIDEO_OUTPUT_DIR=$aerokubeFolder/selenoid/video/ \
aerokube/selenoid:1.11.0 \
-limit 2 -cpu 1.0 -mem 1g -retry-count 10 -capture-driver-logs -timeout 300s -service-startup-timeout 300s -session-attempt-timeout 300s -session-delete-timeout 300s -conf /etc/selenoid/browsers.json -video-output-dir /opt/selenoid/video/ -video-recorder-image selenoid/video-recorder:latest-release -log-output-dir /opt/selenoid/logs/

DOCKER_GATEWAY_ADDR=`docker inspect selenoid -f {{.NetworkSettings.Gateway}}`
docker run -d --name selenoid-ui --restart=always -p 8086:8080 aerokube/selenoid-ui:1.10.10 --selenoid-uri http://${DOCKER_GATEWAY_ADDR}:4444

You should only need to replace YOUR_PATH_TO_BROWSERS_JSON.