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

Selenoid-UI VNC/logs disconnected in linux environment (works in MacOS) #314

Open
Minion0313 opened this issue Mar 7, 2020 · 35 comments
Open
Labels

Comments

@Minion0313
Copy link

Minion0313 commented Mar 7, 2020

image
Hi i am using selenoid and selenoid ui in docker for running selenoium tests
everything works perfectly in Mac os... i am able to see my test executions on the selenoid UI
But the same set up does not work on the linux (My office laptop)
dont know what is the issue
getting vnc disconnected the set up is all same is mac and linux except the difference is that mac is personal system and linux is my office laptop
Please help me resolve the issue
thanks in advance
@vania-pooh

@vania-pooh
Copy link
Member

vania-pooh commented Mar 7, 2020

@Minion0313 take a look at browser images you are using. They should have vnc in image name. If that does not help - please take a look at browser console images.

@Minion0313
Copy link
Author

@vania-pooh Hi thank you for the response
Initially when i installed it had vnc chrome browser
but when i deleted the cm(configuration manager) and re-installed again i am getting only these below images
image
Even though VNC image is not there, i am able to see my tests running on selenoid ui (this is in my personal mac)
But i dont see them running in my Linux my office laptop ( getting vnc disconncted)

and one curious question why i am not getting all the omages which i used to previously the along with vnc now ?

thanks in advance
Response is much appreciated

@Minion0313
Copy link
Author

Minion0313 commented Mar 8, 2020

@Minion0313 take a look at browser images you are using. They should have vnc in image name. If that does not help - please take a look at browser console images.

How can i look at the browser console images???

@Minion0313
Copy link
Author

Minion0313 commented Mar 8, 2020

@vania-pooh I updated my browers.json file and reloaded selenoid
still i am getting the same issue

image

This is only happening in my office laptop --- This is a linux box (Docker is installed in this linux machine)
It works perfectly well in my personal laptop ---This is a mac

@vania-pooh
Copy link
Member

@Minion0313 console messages are usually available in browser developer toolbar. There is a section called Console there. Currently both vnc and non-vnc images contain VNC server. Previously that was not the case.
Screen Shot 2020-03-08 at 11 02 29

@lanwen lanwen changed the title Selenoid -UI VNC disconnced Selenoid-UI VNC/logs disconnected in linux environment (works in MacOS) Mar 10, 2020
@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 It would be helpful if you could provide us selenoid and selenoid-ui logs when this disconnect happens.

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

@lanwen @vania-pooh
hi thank you for the response
i was not able to resolve the issue yet and here are the logs when i am running the tests, this is what it is showing on the selenoid-ui

Please let me know how could i resolve this issue?
Thanks in advance

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 thanks for sharing! I would ask you next time just copy the output and put it here as a text :) and don't forget to edit internal hosts and replace it with something like "our.company.host.com" (literally), so no internal infrastructure is exposed.

As I can see, selenoid is returning Forbidden status code - do you have any kind of auth before selenoid?

@Minion0313
Copy link
Author

@lanwen sure lanwen i will do that , from next time
i did not do anything in particular
when i installed docker i did set up proxy thing in the config file
and also when i pull the selenoid ui image with cm command it wouldn't link properly so i had to remove the image and pull it manually and link it using the below command

docker run -d --name selenoid-ui --link selenoid -p 8080:8080 aerokube/selenoid-ui --selenoid-uri http://myhostname:4444
then only it would be properly connected

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 you then trying to reach wrong host - for the selenoid-ui selenoid-uri should be http://selenoid:4444 can you try that?

What's the issue with cm? Can I kindly ask you to report that to appropriate repo?

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

@Minion0313 you then trying to reach wrong host - for the selenoid-ui selenoid-uri should be http://selenoid:4444 can you try that?

What's the issue with cm? Can I kindly ask you to report that to appropriate repo?

do u mean something linke thsi

docker run -d --name selenoid-ui --link selenoid -p 8080:8080 aerokube/selenoid-ui http://selenoid:4444 http://myhostname:4444

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

@lanwen so the issue with cm i am facing is, when i do
./cm start selenoid-ui
it is no automatically linking the selenoid to selenoid ui port
so i had to giv ethat additional command

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

Not exactly - selenoid-ui doesn't care about your host.
So as stated in docs it should be

docker run -d --name selenoid-ui -p 8080:8080 aerokube/selenoid-ui --link selenoid --selenoid-uri http://selenoid:4444

@Minion0313
Copy link
Author

Not exactly - selenoid-ui doesn't care about your host.
So as stated in docs it should be

docker run -d --name selenoid-ui -p 8080:8080 aerokube/selenoid-ui --link selenoid --selenoid-uri http://selenoid:4444

sorry for asking it again in this url "http://selenoid:4444" selenoid is the host where i am pointing to i mean is it like
ex if selenoid url is http://myhostname:4444
in the url forthe command it should be myhostname or selenoid?
because this is the url i am using to access selenoid http://myhostname:4444 or any status http://myhostname:4444/status or i am able to see when my tests run the session is created in the selenoid ui in http://myhostname:8080(with vnc disconnected issue)

@Minion0313
Copy link
Author

I am not able to link it using the above command , i am anot able to access selenoid ui

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

Just copy as is. selenoid is the host name for the container, not for you.

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

sorry, my bad

docker run -d --name selenoid-ui -p 8080:8080 --link selenoid aerokube/selenoid-ui --selenoid-uri http://selenoid:4444

misplaced link arg

@Minion0313
Copy link
Author

Just copy as is. selenoid is the host name for the container, not for you.

thank u for the reply, so what will be the url for accessing selenoid ui?
will that be the same i.e http://myhostname:8080?
correct me if i am wrong

@Minion0313
Copy link
Author

@lanwen thank u for ur patience

@Minion0313
Copy link
Author

@lanwen corrected and gave the above command
image
this is what it shows

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 please always provide all available logs.
Url for your selenoid-ui access wouldn't change.

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

@lanwen sorry this is what it shows

2020/03/10 13:30:56 [INIT] [Listening on :8080]
2020/03/10 13:31:22 Client added. 1 registered clients
2020/03/10 13:31:22 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:26 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:31 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:36 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:41 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:46 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:51 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:31:56 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:01 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:06 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:11 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:16 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:21 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:26 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:31 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:36 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:41 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:46 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:51 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:32:56 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:01 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:06 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:11 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:16 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:21 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:26 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:31 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 13:33:36 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

Ok, lets get back to the beginning.
Please kill and remove all containers for selenoid and selenoid-ui
then run cm commands as stated in the manual
then if it still shows this picture, provide all the outputs of the commands, docker ls, and docker inspect for the selenoid-ui

@Minion0313
Copy link
Author

@lanwen before using the command which u have given i was using this command

docker run -d --name selenoid-ui -p 8080:8080 --link selenoid aerokube/selenoid-ui --selenoid-uri http://hostname:4444

i was atleast able to see the session created
now i am not able to see any session also

@Minion0313
Copy link
Author

Ok, lets get back to the beginning.
Please kill and remove all containers for selenoid and selenoid-ui
then run cm commands as stated in the manual
then if it still shows this picture, provide all the outputs of the commands, docker ls, and docker inspect for the selenoid-ui

ok i will do that

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

Still facing the same issue @lanwen
here are the steps followed from manual and also the output
befor i started deleted all the images and containers

[root@myhostname myid]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

[root@myhostname myid]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

[root@myhostname selenoid]# curl -s https://aerokube.com/cm/bash | bash

[root@myhostname selenoid]# curl -s https://aerokube.com/cm/bash | bash \
> && ./cm selenoid start --vnc

 █████╗ ███████╗██████╗  ██████╗ ██╗  ██╗██╗   ██╗██████╗ ███████╗     ██████╗███╗   ███╗
██╔══██╗██╔════╝██╔══██╗██╔═══██╗██║ ██╔╝██║   ██║██╔══██╗██╔════╝    ██╔════╝████╗ ████║
███████║█████╗  ██████╔╝██║   ██║█████╔╝ ██║   ██║██████╔╝█████╗      ██║     ██╔████╔██║
██╔══██║██╔══╝  ██╔══██╗██║   ██║██╔═██╗ ██║   ██║██╔══██╗██╔══╝      ██║     ██║╚██╔╝██║
██║  ██║███████╗██║  ██║╚██████╔╝██║  ██╗╚██████╔╝██████╔╝███████╗    ╚██████╗██║ ╚═╝ ██║
╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝     ╚═════╝╚═╝     ╚═╝

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   604  100   604    0     0   3061      0 --:--:-- --:--:-- --:--:--  3065
100 12.5M  100 12.5M    0     0  2805k      0  0:00:04  0:00:04 --:--:-- 3032k

SUCCESSFULLY DOWNLOADED!

Git Revision: 1.7.1
UTC Build Time: 2019-10-08_05:28:51PM

Now you can run Selenoid with cm:
    ./cm selenoid start --vnc

To get instant help just type:
    ./cm --help

> Using Docker
- Your Docker API version is 1.40
> Downloading Selenoid...
- Fetching tags for image aerokube/selenoid
registry.ping url=https://registry.hub.docker.com/v2/
registry.tags url=https://registry.hub.docker.com/v2/aerokube/selenoid/tags/list repository=aerokube/selenoid
- Pulling image aerokube/selenoid:1.10.0
> Selenoid is already configured
> Starting Selenoid...
> Successfully started Selenoid


[root@myhostname selenoid]# ./cm selenoid update
> Using Docker
- Your Docker API version is 1.40
> Downloading Selenoid...
- Fetching tags for image aerokube/selenoid
registry.ping url=https://registry.hub.docker.com/v2/
registry.tags url=https://registry.hub.docker.com/v2/aerokube/selenoid/tags/list repository=aerokube/selenoid
- Pulling image aerokube/selenoid:1.10.0
> Configuring Selenoid...
> Processing browser "firefox"...
- Fetching tags for image selenoid/firefox
registry.tags url=https://registry.hub.docker.com/v2/selenoid/firefox/tags/list repository=selenoid/firefox
- Pulling image selenoid/firefox:73.0
- Pulling image selenoid/firefox:72.0
> Processing browser "chrome"...
- Fetching tags for image selenoid/chrome
registry.tags url=https://registry.hub.docker.com/v2/selenoid/chrome/tags/list repository=selenoid/chrome
- Pulling image selenoid/chrome:80.0
- Pulling image selenoid/chrome:79.0
> Processing browser "opera"...
- Fetching tags for image selenoid/opera
registry.tags url=https://registry.hub.docker.com/v2/selenoid/opera/tags/list repository=selenoid/opera
- Pulling image selenoid/opera:67.0
- Pulling image selenoid/opera:66.0
> Pulling video recorder image...
- Pulling image selenoid/video-recorder:latest-release
> Configuration saved to /root/.aerokube/selenoid/browsers.json
> Stopping previous Selenoid instance...
> Stopping Selenoid...
> Successfully stopped Selenoid
> Starting Selenoid...
> Successfully started Selenoid

[root@myhostname selenoid]# ./cm selenoid-ui start
> Using Docker
- Your Docker API version is 1.40
> Downloading Selenoid UI...
- Fetching tags for image aerokube/selenoid-ui
registry.ping url=https://registry.hub.docker.com/v2/
registry.tags url=https://registry.hub.docker.com/v2/aerokube/selenoid-ui/tags/list repository=aerokube/selenoid-ui
- Pulling image aerokube/selenoid-ui:1.9.2
> Starting Selenoid UI...
> Successfully started Selenoid UI
[root@myhostname selenoid]# docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED              STATUS                    PORTS                    NAMES
0f0d4aab68c5        aerokube/selenoid-ui:1.9.2   "/selenoid-ui --sele…"   22 seconds ago       Up 21 seconds (healthy)   0.0.0.0:8080->8080/tcp   selenoid-ui
9f424bf31c07        aerokube/selenoid:1.10.0     "/usr/bin/selenoid -…"   About a minute ago   Up About a minute         0.0.0.0:4444->4444/tcp   selenoid

Since its is not linking automatically i have deleted the image and given thenext command

[root@myhostname selenoid]# docker run -d --name selenoid-ui -p 8080:8080 --link selenoid aerokube/selenoid-ui --selenoid-uri http://selenoid:4444
7e864ca62c27b41d20be8f7e8d31e6a2c11b71378814bf2504cd96352ce7652b

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 hey, thx a lot, can you elaborate on how do you know its not linking automatically?

Selenoid-ui says its Up 21 seconds (healthy) which exactly means everything was linked fine

@Minion0313
Copy link
Author

@Minion0313 hey, thx a lot, can you elaborate on how do you know its not linking automatically?

Selenoid-ui says its Up 21 seconds (healthy) which exactly means everything was linked fine

Hi on the selenoid-UI It was showing not connected

@Minion0313
Copy link
Author

@Minion0313 hey, thx a lot, can you elaborate on how do you know its not linking automatically?
Selenoid-ui says its Up 21 seconds (healthy) which exactly means everything was linked fine

Hi on the selenoid-UI It was showing not connected

I mean on the actual UI it was not Connected like showing unknown error

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 okay, now I need docker logs for selenoid and selenoid-ui, as well as curl results for the /status endpoint of selenoid (right after you've done with cm)

@Minion0313
Copy link
Author

Minion0313 commented Mar 10, 2020

Hi @lanwen thank you for the response
here is the curl status and docker logs for selenoid and selenoid-ui

[root@myhostname myid]# curl http://myhostname.tech.com:4444/status
{"total":5,"used":0,"queued":0,"pending":0,"browsers":{"chrome":{"79.0":{},"80.0":{}},"firefox":{"72.0":{},"73.0":{}},"opera":{"66.0":{},"67.0":{}}}}
[root@myhostname myid]# docker logs selenoid -f
2020/03/10 13:55:11 [-] [INIT] [Loading configuration files...]
2020/03/10 13:55:11 [-] [INIT] [Loaded configuration from /etc/selenoid/browsers.json]
2020/03/10 13:55:11 [-] [INIT] [Video Dir: /opt/selenoid/video]
2020/03/10 13:55:11 [-] [INIT] [Logs Dir: /opt/selenoid/logs]
2020/03/10 13:55:11 [-] [INIT] [Using Docker API version: 1.40]
2020/03/10 13:55:11 [-] [INIT] [Timezone: UTC]
2020/03/10 13:55:11 [-] [INIT] [Listening on :4444]
[root@myhostname myid]# docker logs --tail 15 selenoid-ui
2020/03/10 16:51:48 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:51:53 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:51:58 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:03 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:08 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:13 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:18 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:23 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:28 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:33 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:38 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:43 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:48 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:53 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]
2020/03/10 16:52:58 [ERROR] [Can't get status: invalid character '<' looking for beginning of value]

@Minion0313
Copy link
Author

@lanwen dev console status

image

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 thank you a lot, wondering why selenoid-ui gets html instead of json as a response for status.

You greatly could help to identify the issue if would launch ubuntu container same way linked to a selenoid and launch curl for the http://selenoid/status (basically repeat what selenoid-ui) is doing.

I would try to reproduce that on my side in a few days.

Thank's a lot, appreciate your help in investigations

@Minion0313
Copy link
Author

@lanwen thank u for the help how could i fix the actual issue now

@lanwen
Copy link
Collaborator

lanwen commented Mar 10, 2020

@Minion0313 that still not clear for me, that's why I need further assistance from your side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants