docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

[🐛 Bug]: /wd/hub/status return 000 in latest build , while it is working fine in 4.14

Open Vijayasok89 opened this issue 3 years ago • 9 comments

What happened?

Bug Description:

Issue: The status check of the Selenium Hub using the provided curl command returns a status code of 000 instead of the expected 200.

Steps to Reproduce:

Execute the following curl command to check the status of the Selenium Hub: curl --write-out %{http_code} --silent --output /dev/null http://selenium-hub:4444/wd/hub/status Expected Result: The curl command should return a status code of 200, indicating a successful connection to the Selenium Hub.

Actual Result: The curl command returns a status code of 000, which is unexpected and indicates a failure to establish a connection to the Selenium Hub.

Additional Information:

This issue is specific to the tag/version 4.15 of the Selenium server, as it worked fine with the previous version (4.14).

Impact:

Users relying on the curl command to check the status of the Selenium Hub are unable to accurately determine its connectivity and status. Note:

The issue is reproducible consistently.

Command used to start Selenium Grid with Docker

SELENIUM_COMPOSE_FILE='selenium_files/selenium-compose.yml'
docker compose -f ${SELENIUM_COMPOSE_FILE} up -d

Relevant log output

checking hub status using below curl command  returns 000 
curl --write-out %{http_code} --silent --output /dev/null http://selenium-hub:4444/wd/hub/status
selenium server curl status code :000

The same worked fine with tag 4.14
 curl --write-out %{http_code} --silent --output /dev/null http://selenium-hub:4444/wd/hub/status
 selenium server curl status code :200

Operating System

linux

Docker Selenium version (tag)

4.15

Vijayasok89 avatar Nov 14 '23 03:11 Vijayasok89

@Vijayasok89, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Nov 14 '23 03:11 github-actions[bot]

I cannot reproduce this, I used docker-compose -f docker-compose-v3.yml up from the repository.

gitpod /workspace/docker-selenium (diemol/bug-wd-hub-status-return-2011) $ curl --write-out %{http_code} --silent --output /dev/null http://localhost:4444/wd/hub/status 200 gitpod /workspace/docker-selenium (diemol/bug-wd-hub-status-return-2011) $

diemol avatar Nov 14 '23 10:11 diemol

@diemol Could you please try running the command from another container called "test container"? The "selenium-hub" container and the "test container" are in the same network called "pytest".

By running the command from the "test container" within the "pytest" network, we can ensure that both containers are properly connected and have network connectivity

Vijayasok89 avatar Nov 14 '23 12:11 Vijayasok89

Why don't you provide the docker compose file I can use to reproduce this?

diemol avatar Nov 14 '23 13:11 diemol

@diemol sorry for the delay in response It looks like this issue is reproducible in my Jenkins environment, where the agent is running on Ubuntu 18.04 with Docker client version : Docker version 20.10.24, build 297e128 Steps to reproduce:

  1. in terminal goto demo folder build the image : docker build -f Dockerfile -t pytest-app:v1 .
  2. create docker network : docker network create pytest-network
  3. spin up the selenium containers : docker-compose -f selenium-compose.yml up -d
  4. spin up pytest container: docker-compose -f docker-compose.yml up

demo-selenium 2.zip

Vijayasok89 avatar Nov 16 '23 12:11 Vijayasok89

Hi @Vijayasok89, probably I reproduced the issue with your docker-compose file provided. I think this config in compose file make the status returned 000

services:
  selenium-hub:
    ...
    networks:
        pytest-network:
            aliases:
                - hostname

When the alias is set, I think have to use hostname in the curl URL

curl --write-out %{http_code} --silent --output /dev/null http://selenium-hub:4444/wd/hub/status
000
curl --write-out %{http_code} --silent --output /dev/null http://$(hostname):4444/wd/hub/status
200

VietND96 avatar Nov 17 '23 06:11 VietND96

Thanks for triaging, @vietnd96!

@Vijayasok89 this seems to be something in your setup, rather than something in Selenium. I will close this but feel free to continue the conversation.

diemol avatar Nov 17 '23 10:11 diemol

I'm betting that "hostname" is a conflicting name, because it is a proper command that exist in most Unixes

luisfcorreia avatar Nov 17 '23 10:11 luisfcorreia

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 18 '23 00:12 github-actions[bot]