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

[🐛 Bug]: Squid Proxy being injected into session creation when on gitlab. #9967

Closed
alex4200 opened this issue Oct 21, 2021 · 10 comments
Closed

Comments

@alex4200
Copy link

What happened?

When I run a gitlab pipeline with a short test code with selenium 4.0 it fails. With selenium 3.141 it works. No other change has been made

How can we reproduce the issue?

Run the following code on gitlab:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(options=chrome_options)
driver.quit()

with either selenium 4.0 or 3.141. Used version of chrome: 92.0.4515.107-1_amd64
Used version of chromedriver: 92.0.4515.43

Relevant log output

$ python tester.py
Traceback (most recent call last):
  File "tester.py", line 7, in <module>
    driver = webdriver.Chrome(options=chrome_options)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__
    RemoteWebDriver.__init__(
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 266, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 357, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 418, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 207, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2016 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" CONTENT="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!-- 
 /*
 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
 *
 * Squid software is distributed under GPLv2+ license and includes
 * contributions from numerous individuals and organizations.
 * Please see the COPYING and CONTRIBUTORS files for details.
 */
/*
 Stylesheet for Squid Error pages
 Adapted from design by Free CSS Templates
 http://www.freecsstemplates.org
 Released for free under a Creative Commons Attribution 2.5 License
*/
/* Page basics */
* {
	font-family: verdana, sans-serif;
}
html body {
	margin: 0;
	padding: 0;
	background: #efefef;
	font-size: 12px;
	color: #1e1e1e;
}
/* Page displayed title area */
#titles {
	margin-left: 15px;
	padding: 10px;
	padding-left: 100px;
	background: url('/squid-internal-static/icons/SN.png') no-repeat left;
}
/* initial title */
#titles h1 {
	color: #000000;
}
#titles h2 {
	color: #000000;
}
/* special event: FTP success page titles */
#titles ftpsuccess {
	background-color:#00ff00;
	width:100%;
}
/* Page displayed body content area */
#content {
	padding: 10px;
	background: #ffffff;
}
/* General text */
p {
}
/* error brief description */
#error p {
}
/* some data which may have caused the problem */
#data {
}
/* the error message received from the system or other software */
#sysmsg {
}
pre {
    font-family:sans-serif;
}
/* special event: FTP / Gopher directory listing */
#dirmsg {
    font-family: courier;
    color: black;
    font-size: 10pt;
}
#dirlisting {
    margin-left: 2%;
    margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
    border-bottom: groove;
}
#dirlisting td.size {
    width: 50px;
    text-align: right;
    padding-right: 5px;
}
/* horizontal lines */
hr {
	margin: 0;
}
/* page displayed footer area */
#footer {
	font-size: 9px;
	padding-left: 10px;
}
body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
 --></style>
</head><body id=ERR_CONNECT_FAIL>
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://localhost:51881/session">http://localhost:51881/session</a></p>
<blockquote id="error">
<p><b>Connection to ::1 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>

Operating System

ubuntu I guess

Selenium version

4.0.0

What are the browser(s) and version(s) where you see this issue?

chrome: 92.0.4515.107-1_amd64

What are the browser driver(s) and version(s) where you see this issue?

chromedriver: 92.0.4515.43

Are you using Selenium Grid?

no

@github-actions
Copy link

@alex4200, 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.

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

Thank you!

@AutomatedTester
Copy link
Member

Looking at this issue it looks like a proxy is blocking the calls for some reason. It could be related to #9925 or something else.

Please can you put a list of all the environment variables that are in use in your CI and any other bits of information that we can use to help debug. We don't have a gitlab setup so this will require you to help us.

@AutomatedTester AutomatedTester changed the title [🐛 Bug]: [🐛 Bug]: Squid Proxy being injected into session creation when on gitlab. Oct 21, 2021
@alex4200
Copy link
Author

There are five variables that are related to a proxy:

HTTPS_PROXY=http://some.url:80
HTTP_PROXY=http://some.url:80
http_proxy=http://some.url:80
https_proxy=http://some.url:80
no_proxy='65.253.214.253,localhost,127.0.0.1,*zyz.xx'

other variables:

BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="5" [1]="0" [2]="3" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='5.0.3(1)-release'
CI=true
CI_API_V4_URL=https://some/api/url
CI_BUILDS_DIR=/builds
CI_BUILD_BEFORE_SHA=0000000000000000000000000000000000000000
CI_BUILD_ID=77884
CI_BUILD_NAME=testjob
CI_BUILD_REF=643ca25281689b94ececd95b58b76aff1fb7f273
CI_BUILD_REF_NAME=sel4
CI_BUILD_REF_SLUG=sel4
CI_BUILD_STAGE=stageTest
CI_BUILD_TOKEN=[MASKED]
CI_COMMIT_AUTHOR='author <[email protected]>'
CI_COMMIT_BEFORE_SHA=0000000000000000000000000000000000000000
CI_COMMIT_DESCRIPTION=
CI_COMMIT_MESSAGE=$'getting variables\n'
CI_COMMIT_REF_NAME=sel4
CI_COMMIT_REF_PROTECTED=false
CI_COMMIT_REF_SLUG=sel4
CI_COMMIT_SHA=643ca26481689b94ecedc1b558b76affafd7f933
CI_COMMIT_SHORT_SHA=643ca264
CI_COMMIT_TIMESTAMP=2021-10-21T16:16:48+02:00
CI_COMMIT_TITLE='getting variables'
CI_CONCURRENT_ID=0
CI_CONCURRENT_PROJECT_ID=0
CI_CONFIG_PATH=.gitlab-ci.yml
CI_DEFAULT_BRANCH=main
CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX=some.url:443/group/dependency_proxy/containers
CI_DEPENDENCY_PROXY_PASSWORD=[MASKED]
CI_DEPENDENCY_PROXY_SERVER=some.url:443
CI_DEPENDENCY_PROXY_USER=gitlab-ci-token
CI_DISPOSABLE_ENVIRONMENT=true
CI_JOB_ID=77884
CI_JOB_IMAGE=python:3.8-buster
CI_JOB_JWT=[MASKED]
CI_JOB_NAME=testjob
CI_JOB_STAGE=stageTest
CI_JOB_STARTED_AT=2021-10-21T14:16:57Z
CI_JOB_STATUS=running
CI_JOB_TOKEN=[MASKED]
CI_JOB_URL=https://some.url/grop/personal/testproject/-/jobs/77884
CI_MERGE_REQUEST_DIFF_BASE_SHA=dba5f25dddd47608334e1d13b3b1641b13abd5a4
CI_MERGE_REQUEST_DIFF_ID=16911
CI_MERGE_REQUEST_EVENT_TYPE=detached
CI_MERGE_REQUEST_ID=5008
CI_MERGE_REQUEST_IID=23
CI_MERGE_REQUEST_PROJECT_ID=230
CI_MERGE_REQUEST_PROJECT_PATH=group/personal/testproject
CI_MERGE_REQUEST_PROJECT_URL=https://some.url/grop/personal/testproject
CI_MERGE_REQUEST_REF_PATH=refs/merge-requests/23/head
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME=sel4
CI_MERGE_REQUEST_SOURCE_BRANCH_SHA=
CI_MERGE_REQUEST_SOURCE_PROJECT_ID=230
CI_MERGE_REQUEST_SOURCE_PROJECT_PATH=group/personal/testproject
CI_MERGE_REQUEST_SOURCE_PROJECT_URL=https://some.url/grop/personal/testproject
CI_MERGE_REQUEST_TARGET_BRANCH_NAME=main
CI_MERGE_REQUEST_TARGET_BRANCH_SHA=
CI_MERGE_REQUEST_TITLE='testrun selenium 3.141'
CI_NODE_TOTAL=1
CI_OPEN_MERGE_REQUESTS='group/personal/testproject!23'
CI_PIPELINE_CREATED_AT=2021-10-21T14:16:53Z
CI_PIPELINE_ID=21080
CI_PIPELINE_IID=166
CI_PIPELINE_SOURCE=merge_request_event
CI_PIPELINE_URL=https://some.url/grop/personal/testproject/-/pipelines/21080
CI_PROJECT_CLASSIFICATION_LABEL=
CI_PROJECT_DIR=/builds/group/personal/testproject
CI_PROJECT_ID=230
CI_PROJECT_NAME=testproject
CI_PROJECT_NAMESPACE=group/personal
CI_PROJECT_PATH=group/personal/testproject
CI_PROJECT_PATH_SLUG=group-personal-testproject
CI_PROJECT_REPOSITORY_LANGUAGES=python
CI_PROJECT_ROOT_NAMESPACE=group
CI_PROJECT_TITLE=TestProject
CI_PROJECT_URL=https://some.url/grop/personal/testproject
CI_PROJECT_VISIBILITY=internal
CI_REGISTRY=some.url:5050
CI_REGISTRY_IMAGE=some.url:5050/group/personal/testproject
CI_REGISTRY_PASSWORD=[MASKED]
CI_REGISTRY_USER=gitlab-ci-token
CI_REPOSITORY_URL=https://gitlab-ci-token:[MASKED]@some.url/group/personal/testproject.git
CI_RUNNER_DESCRIPTION=depcb063.someother.url
CI_RUNNER_EXECUTABLE_ARCH=linux/amd64
CI_RUNNER_ID=66
CI_RUNNER_REVISION=58ba2b95
CI_RUNNER_SHORT_TOKEN=nYre4v-H
CI_RUNNER_TAGS='docker, distributedcache, c4r4, depcb063.someother.url'
CI_RUNNER_VERSION=14.2.0
CI_SERVER=yes
CI_SERVER_HOST=some.url
CI_SERVER_NAME=GitLab
CI_SERVER_PORT=443
CI_SERVER_PROTOCOL=https
CI_SERVER_REVISION=72c1da0383a
CI_SERVER_TLS_CA_FILE=/builds/group/personal/testproject.tmp/CI_SERVER_TLS_CA_FILE
CI_SERVER_URL=some.url
CI_SERVER_VERSION=14.2.5-ee
CI_SERVER_VERSION_MAJOR=14
CI_SERVER_VERSION_MINOR=2
CI_SERVER_VERSION_PATCH=5
DEVPI_PASSWORD=[MASKED]
DEVPI_USER=[MASKED]
DIRSTACK=()
DOCS_INTERNAL_TOKEN=[MASKED]
DOCS_INTERNAL_TOKEN_NAME=[MASKED]
EUID=0
FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION=false
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR=false
FF_ENABLE_BASH_EXIT_CODE_CHECK=false
FF_GITLAB_REGISTRY_HELPER_IMAGE=true
FF_NETWORK_PER_BUILD=false
FF_SCRIPT_SECTIONS=false
FF_SKIP_DOCKER_MACHINE_PROVISION_ON_CREATION_FAILURE=true
FF_SKIP_NOOP_BUILD_STAGES=true
FF_USE_DIRECT_DOWNLOAD=true
FF_USE_DYNAMIC_TRACE_FORCE_SEND_INTERVAL=false
FF_USE_FASTZIP=false
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY=false
FF_USE_NEW_BASH_EVAL_STRATEGY=false
FF_USE_POWERSHELL_PATH_RESOLVER=false
FF_USE_WINDOWS_LEGACY_PROCESS_STRATEGY=true
GITLAB_CI=true
GITLAB_FEATURES=audit_events,blocked_issues,board_iteration_lists,code_owners,code_review_analytics,contribution_analytics,description_diffs,elastic_search,full_codequality_report,group_activity_analytics,group_bulk_edit,group_webhooks,issuable_default_templates,issue_weights,iterations,ldap_group_sync,member_lock,merge_request_approvers,milestone_charts,multiple_issue_assignees,multiple_ldap_servers,multiple_merge_request_assignees,multiple_merge_request_reviewers,project_merge_request_analytics,protected_refs_for_users,push_rules,repository_mirrors,repository_size_limit,resource_access_token,seat_link,scoped_issue_board,usage_quotas,visual_review_app,wip_limits,send_emails_from_admin_area,adjourned_deletion_for_projects_and_groups,admin_audit_log,auditor_user,blocking_merge_requests,board_assignee_lists,board_milestone_lists,ci_cd_projects,ci_secrets_management,cluster_agents,cluster_deployments,code_owner_approval_required,commit_committer_check,compliance_framework,custom_compliance_frameworks,cross_project_pipelines,custom_file_templates,custom_file_templates_for_namespace,custom_project_templates,cycle_analytics_for_groups,cycle_analytics_for_projects,db_load_balancing,default_branch_protection_restriction_in_groups,default_project_deletion_protection,disable_name_update_for_users,email_additional_text,epics,extended_audit_events,external_authorization_service_api_management,feature_flags_related_issues,file_locks,geo,generic_alert_fingerprinting,git_two_factor_enforcement,github_project_service_integration,group_allowed_email_domains,group_coverage_reports,group_forking_protection,group_ip_restriction,group_merge_request_analytics,group_merge_request_approval_settings,group_milestone_project_releases,group_project_templates,group_repository_analytics,group_saml,group_saml_group_sync,group_scoped_ci_variables,group_wikis,incident_sla,incident_metric_upload,ide_schema_config,issues_analytics,jira_issues_integration,ldap_group_sync_filter,merge_pipelines,merge_request_performance_metrics,admin_merge_request_approvers_rules,merge_trains,metrics_reports,multiple_alert_http_integrations,multiple_approval_rules,multiple_group_issue_boards,multiple_iteration_cadences,object_storage,operations_dashboard,package_forwarding,pages_size_limit,productivity_analytics,project_aliases,protected_environments,reject_unsigned_commits,required_ci_templates,scoped_labels,smartcard_auth,swimlanes,type_of_work_analytics,minimal_access_role,unprotection_restrictions,ci_project_subscriptions,incident_timeline_view,oncall_schedules,escalation_policies,export_user_permissions
[email protected]
GITLAB_USER_ID=51
GITLAB_USER_LOGIN=login
GITLAB_USER_NAME='Full Name'
GPG_KEY=E3FF2629C048B25C185DEBE9B26DB1E310250568
GROUPS=()
HOME=/root
HOSTNAME=runner-nzrbgv-h-project-230-concurrent-0
HOSTTYPE=x86_64
HTTPS_PROXY=http://myproxy.abc.xy:80
HTTP_PROXY=http://myproxy.abc.xy:80
IFS=$' \t\n'
LANG=C.UTF-8
MACHTYPE=x86_64-pc-linux-gnu
NO_PROXY='65.253.214.253,localhost,127.0.0.1,*zyz.xx,...' # here some more entries
OLDPWD=/
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/builds/group/personal/testproject:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PIPESTATUS=([0]="0")
PPID=0
PS4='+ '
PWD=/builds/group/personal/testproject
PYTHON_GET_PIP_SHA256=de6f33da3cce234cd4e8d184eb54a51ab9c247653b52855a18dbd44e6b21ff8b
PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/c20b0cfd643cd4a19246ccf204e2997af70f6b21/public/get-pip.py
PYTHON_PIP_VERSION=21.2.3
PYTHON_VERSION=3.8.11
S3ACCESS=[MASKED]
S3SECRET=[MASKED]
SHELL=/bin/bash
SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:pipefail
SHLVL=1
TERM=dumb
UID=0
_=$'\E[32;1m$ set\E[0;m'
http_proxy=http://myproxy.abc.xy:80
https_proxy=http://myproxy.abc.xy:80
no_proxy='65.253.214.253,localhost,127.0.0.1,*zyz.xx,...' # here some more entries
pipeline=0

@MysticalMount
Copy link

Hi, we are suffering from this issue, I cant see any PR but I can see a commit (153298f) is there any ticket that remains open for us to track this?

@ccxuy
Copy link

ccxuy commented Dec 6, 2021

Hi, we are suffering from this issue, I cant see any PR but I can see a commit (153298f) is there any ticket that remains open for us to track this?

I have the same problem, and if I roll back Selenium to version 3.141.0. then the problem disappear.

@AutomatedTester
Copy link
Member

This has been released in 4.1. I don't have a proxy environment so if you have a look at the change that was made and are able to help fix it that would be great. The code should be handled now for gitlab since we're now handling NO_PROXY according to our tests.

@alex4200
Copy link
Author

alex4200 commented Dec 6, 2021

The above mentioned error I experienced with selenium 4.0 does not seem to happen again with selenium 4.1.

It really looks there was a bug and it is fixed now. Thanks!

@AutomatedTester
Copy link
Member

The above mentioned error I experienced with selenium 4.0 does not seem to happen again with selenium 4.1.

It really looks there was a bug and it is fixed now. Thanks!

Perfect!

@kisuro
Copy link

kisuro commented Dec 16, 2021

I still have this issue on selenium 4.1.0 (3.141.0 - work correctly, just update selenium version)

proxy variables:

CHROME_ENV_HTTPS_PROXY="http://mycompany.com:3128"
CHROME_ENV_HTTP_PROXY="http://mycompany.com:3128"
NO_PROXY=".somedom.com,.somedom2.com,unix,docker,localhost,.somedom3.com,,10.0.0.0/8,172.22.0.0/16,.somedom4.com"

chrome var:

CHROME_PORT_4444_TCP="tcp://172.17.0.2:4444"
CHROME_PORT_4444_TCP_ADDR="172.17.0.2"
CHROME_PORT_4444_TCP_PORT="4444"
CHROME_PORT_4444_TCP_PROTO="tcp"
CHROME_PORT_5900_TCP="tcp://172.17.0.2:5900"
CHROME_PORT_5900_TCP_ADDR="172.17.0.2"
CHROME_PORT_5900_TCP_PORT="5900"

in gitlab-ci.yml selenium as service:

  services:
    - name: selenium/standalone-chrome:latest
      alias: chrome

specify remote url in app:

http://chrome:4444/wd/hub 
also try: http://chrome:4444

log snap with error:

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f529da01510>
response = {'status': [13, 'unknown error'], 'value': '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/ht...u, 16 Dec 2021 07:12:20 GMT by MagentaCICD_External (squid/3.5.27)</p>\n<!-- ERR_DNS_FAIL -->\n</div>\n</body></html>'}
    def check_response(self, response: Dict[str, Any]) -> None:
        """
        Checks that a JSON response from the WebDriver does not have an error.
    
        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.
    
        :Raises: If the response contains an error message.
        """
        status = response.get('status', None)
        if not status or status == ErrorCode.SUCCESS:
            return
        value = None
        message = response.get("message", "")
        screen: str = response.get("screen", "")
        stacktrace = None
        if isinstance(status, int):
            value_json = response.get('value', None)
            if value_json and isinstance(value_json, str):
                import json
                try:
                    value = json.loads(value_json)
                    if len(value.keys()) == 1:
                        value = value['value']
                    status = value.get('error', None)
                    if not status:
                        status = value.get("status", ErrorCode.UNKNOWN_ERROR)
                        message = value.get("value") or value.get("message")
                        if not isinstance(message, str):
                            value = message
                            message = message.get('message')
                    else:
                        message = value.get('message', None)
                except ValueError:
                    pass
    
        exception_class: Type[WebDriverException]
        if status in ErrorCode.NO_SUCH_ELEMENT:
            exception_class = NoSuchElementException
        elif status in ErrorCode.NO_SUCH_FRAME:
            exception_class = NoSuchFrameException
        elif status in ErrorCode.NO_SUCH_SHADOW_ROOT:
            exception_class = NoSuchShadowRootException
        elif status in ErrorCode.NO_SUCH_WINDOW:
            exception_class = NoSuchWindowException
        elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
            exception_class = StaleElementReferenceException
        elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
            exception_class = ElementNotVisibleException
        elif status in ErrorCode.INVALID_ELEMENT_STATE:
            exception_class = InvalidElementStateException
        elif status in ErrorCode.INVALID_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR \
                or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
            exception_class = InvalidSelectorException
        elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
            exception_class = ElementNotSelectableException
        elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE:
            exception_class = ElementNotInteractableException
        elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
            exception_class = InvalidCookieDomainException
        elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
            exception_class = UnableToSetCookieException
        elif status in ErrorCode.TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.SCRIPT_TIMEOUT:
            exception_class = TimeoutException
        elif status in ErrorCode.UNKNOWN_ERROR:
            exception_class = WebDriverException
        elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
            exception_class = UnexpectedAlertPresentException
        elif status in ErrorCode.NO_ALERT_OPEN:
            exception_class = NoAlertPresentException
        elif status in ErrorCode.IME_NOT_AVAILABLE:
            exception_class = ImeNotAvailableException
        elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
            exception_class = ImeActivationFailedException
        elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
            exception_class = MoveTargetOutOfBoundsException
        elif status in ErrorCode.JAVASCRIPT_ERROR:
            exception_class = JavascriptException
        elif status in ErrorCode.SESSION_NOT_CREATED:
            exception_class = SessionNotCreatedException
        elif status in ErrorCode.INVALID_ARGUMENT:
            exception_class = InvalidArgumentException
        elif status in ErrorCode.NO_SUCH_COOKIE:
            exception_class = NoSuchCookieException
        elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN:
            exception_class = ScreenshotException
        elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED:
            exception_class = ElementClickInterceptedException
        elif status in ErrorCode.INSECURE_CERTIFICATE:
            exception_class = InsecureCertificateException
        elif status in ErrorCode.INVALID_COORDINATES:
            exception_class = InvalidCoordinatesException
        elif status in ErrorCode.INVALID_SESSION_ID:
            exception_class = InvalidSessionIdException
        elif status in ErrorCode.UNKNOWN_METHOD:
            exception_class = UnknownMethodException
        else:
            exception_class = WebDriverException
        if not value:
            value = response['value']
        if isinstance(value, str):
>           raise exception_class(value)
E           selenium.common.exceptions.WebDriverException: Message: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
E           <html><head>
E           <meta type="copyright" content="Copyright (C) 1996-2017 The Squid Software Foundation and contributors">
E           <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
E           <title>ERROR: The requested URL could not be retrieved</title>
E           <style type="text/css"><!-- 
E            /*
E            * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
E            *
E            * Squid software is distributed under GPLv2+ license and includes
E            * contributions from numerous individuals and organizations.
E            * Please see the COPYING and CONTRIBUTORS files for details.
E            */
E           
E           /*
E            Stylesheet for Squid Error pages
E            Adapted from design by Free CSS Templates
E            http://www.freecsstemplates.org
E            Released for free under a Creative Commons Attribution 2.5 License
E           */
E           
E           /* Page basics */
E           * {
E           	font-family: verdana, sans-serif;
E           }
E           
E           html body {
E           	margin: 0;
E           	padding: 0;
E           	background: #efefef;
E           	font-size: 12px;
E           	color: #1e1e1e;
E           }
E           
E           /* Page displayed title area */
E           #titles {
E           	margin-left: 15px;
E           	padding: 10px;
E           	padding-left: 100px;
E           	background: url('/squid-internal-static/icons/SN.png') no-repeat left;
E           }
E           
E           /* initial title */
E           #titles h1 {
E           	color: #000000;
E           }
E           #titles h2 {
E           	color: #000000;
E           }
E           
E           /* special event: FTP success page titles */
E           #titles ftpsuccess {
E           	background-color:#00ff00;
E           	width:100%;
E           }
E           
E           /* Page displayed body content area */
E           #content {
E           	padding: 10px;
E           	background: #ffffff;
E           }
E           
E           /* General text */
E           p {
E           }
E           
E           /* error brief description */
E           #error p {
E           }
E           
E           /* some data which may have caused the problem */
E           #data {
E           }
E           
E           /* the error message received from the system or other software */
E           #sysmsg {
E           }
E           
E           pre {
E               font-family:sans-serif;
E           }
E           
E           /* special event: FTP / Gopher directory listing */
E           #dirmsg {
E               font-family: courier;
E               color: black;
E               font-size: 10pt;
E           }
E           #dirlisting {
E               margin-left: 2%;
E               margin-right: 2%;
E           }
E           #dirlisting tr.entry td.icon,td.filename,td.size,td.date {
E               border-bottom: groove;
E           }
E           #dirlisting td.size {
E               width: 50px;
E               text-align: right;
E               padding-right: 5px;
E           }
E           
E           /* horizontal lines */
E           hr {
E           	margin: 0;
E           }
E           
E           /* page displayed footer area */
E           #footer {
E           	font-size: 9px;
E           	padding-left: 10px;
E           }
E           
E           
E           body
E           :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
E           :lang(he) { direction: rtl; }
E            --></style>
E           </head><body id=ERR_DNS_FAIL>
E           <div id="titles">
E           <h1>ERROR</h1>
E           <h2>The requested URL could not be retrieved</h2>
E           </div>
E           <hr>
E           
E           <div id="content">
E           <p>The following error was encountered while trying to retrieve the URL: <a href="http://chrome:4444/wd/hub//session">http://chrome:4444/wd/hub//session</a></p>
E           
E           <blockquote id="error">
E           <p><b>Unable to determine IP address from host name <q>chrome</q></b></p>
E           </blockquote>
E           
E           <p>The DNS server returned:</p>
E           <blockquote id="data">
E           <pre>Server Failure: The name server was unable to process this query.</pre>
E           </blockquote>
E           
E           <p>This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.</p>
E           
E           <p>Your cache administrator is <a href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_DNS_FAIL&amp;body=CacheHost%3A%20Company_External%0D%0AErrPage%3A%20ERR_DNS_FAIL%0D%0AErr%3A%20%5Bnone%5D%0D%0ADNS%20ErrMsg%3A%20Server%20Failure%3A%20The%20name%20server%20was%20unable%20to%20process%20this%20query.%0D%0ATimeStamp%3A%20Thu,%2016%20Dec%202021%2007%3A12%3A20%20GMT%0D%0A%0D%0AClientIP%3A%20100.125.67.130%0D%0A%0D%0AHTTP%20Request%3A%0D%0APOST%20%2Fwd%2Fhub%2F%2Fsession%20HTTP%2F1.1%0AAccept-Encoding%3A%20identity%0D%0AContent-Length%3A%20818%0D%0AAccept%3A%20application%2Fjson%0D%0AContent-Type%3A%20application%2Fjson%3Bcharset%3DUTF-8%0D%0AUser-Agent%3A%20selenium%2F4.1.0%20(python%20linux)%0D%0AVia%3A%201.1%20Company_Internal_Proxy%20(squid%2F3.5.27)%0D%0AX-Forwarded-For%3A%2010.14.252.3%0D%0ACache-Control%3A%20max-age%3D259200%0D%0AConnection%3A%20keep-alive%0D%0AHost%3A%20chrome%3A4444%0D%0A%0D%0A%0D%0A">webmaster</a>.</p>
E           <br>
E           </div>
E           
E           <hr>
E           <div id="footer">
E           <p>Generated Thu, 16 Dec 2021 07:12:20 GMT by Company_External (squid/3.5.27)</p>
E           <!-- ERR_DNS_FAIL -->
E           </div>
E           </body></html>
/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py:211: WebDriverException

@github-actions
Copy link

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 github-actions bot locked and limited conversation to collaborators Jan 16, 2022
elgatov pushed a commit to elgatov/selenium that referenced this issue Jun 27, 2022
If people are setting no_proxy for certain values to get around the need
to have a proxy for localhost, mostly, then we should set the poolmanager
to proxymanager if not in no_proxy or poolmanager if it is.

Fixes SeleniumHQ#9925
Fixes SeleniumHQ#9967
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants