Skip to content

Getting Could not connect to port 4444 on host Could not get IP address for host error #134

Description

@patcadelina

My Jenkins and nodes are setup in AWS as EC2 instances. Jenkins host lives in the same VPC as the nodes although they live in separate subnets. The way the security groups are configured is that nodes connect to a load balancer listening on http://custom.url:4444 which then forwards traffic to the Jenkins host. The Jenkins host is allowed to do health checks on the node using their internal IP on port 4444. Additionally, an entry to /etc/hosts file had to be added on Jenkins master so that nodes are able to register to this custom URL.

0.0.0.0 custom.url

Using this configuration, I'm able to successfully register nodes as reported both on UI and from logs. However, when I try to submit a selenium job to the grid, I get the above errors. Happens on both Chrome and Firefox browsers.

I point the tests to the custom URL in my Jenkinsfile as pybot --variable LOCALHOST:http://custom.url:4444/wd/hub src/.

Relevant logs from log.html:

FAIL 	No browser is open 	
DEBUG 	Traceback (most recent call last):
  File "<decorator-gen-147>", line 2, in capture_page_screenshot
  File "/usr/local/lib/python2.7/site-packages/Selenium2Library/keywords/keywordgroup.py", line 15, in _run_on_failure_decorator
    return method(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/Selenium2Library/keywords/_screenshot.py", line 90, in capture_page_screenshot
    if hasattr(self._current_browser(), 'get_screenshot_as_file'):
  File "/usr/local/lib/python2.7/site-packages/Selenium2Library/keywords/_browsermanagement.py", line 516, in _current_browser
    raise RuntimeError('No browser is open')

INFO 	Opening browser 'firefox' to base url 'https://<redacted>' through remote server at 'http://custom.url:4444/wd/hub' 	
INFO 	Could not connect to port 4444 on host custom.url
INFO 	Could not get IP address for host: custom.url

Environment:
hub: Ubuntu
nodes: Windows
packages installed on the nodes:

> choco list --local-only 
Chocolatey v0.10.11
chocolatey 0.10.11
chocolatey-core.extension 1.3.3
chromedriver 2.410
curl 7.61.1
Firefox 62.0
git 2.19.0
git.install 2.19.0
GoogleChrome 69.0.3497.9200
javaruntime 8.0.151
jdk8 8.0.181
jre8 8.0.181
python2 2.7.15
selenium-chrome-driver 2.41
13 packages installed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions