You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running my tests as part of the development pipeline inside a container. When I tried test containers I got the following error: requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Can someone please help?
Thanks
Reacted by Jim Simon, Aleksandr Kotlyar and Walt Panfil
FROM python:3.6.6-alpine3.7
ADD requirements.txt /app/requirements.txt
WORKDIR /app
VOLUME /var/run/docker.sock:/var/run/docker.sock
RUN pip install --no-cache-dir -r requirements.txt
Detailed log:
------------------------------ Captured log setup ------------------------------
conftest.py 10 INFO browser init
_ ERROR at setup of TestMainSliderControls.test_slider_arrows_both_active_on_the_middle_slides _
/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:600: in urlopen
chunked=chunked)
/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:354: in _make_request
conn.request(method, url, **httplib_request_kw)
/usr/local/lib/python3.6/http/client.py:1239: in request
self._send_request(method, url, body, headers, encode_chunked)
/usr/local/lib/python3.6/http/client.py:1285: in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
/usr/local/lib/python3.6/http/client.py:1234: in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
/usr/local/lib/python3.6/http/client.py:1026: in _send_output
self.send(msg)
/usr/local/lib/python3.6/http/client.py:964: in send
self.connect()
/usr/local/lib/python3.6/site-packages/docker/transport/unixconn.py:43: in connect
sock.connect(self.unix_socket)
E FileNotFoundError: [Errno 2] No such file or directory
During handling of the above exception, another exception occurred:
/usr/local/lib/python3.6/site-packages/requests/adapters.py:449: in send
timeout=timeout
/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:638: in urlopen
_stacktrace=sys.exc_info()[2])
/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py:368: in increment
raise six.reraise(type(error), error, _stacktrace)
/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py:685: in reraise
raise value.with_traceback(tb)
/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:600: in urlopen
chunked=chunked)
/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:354: in _make_request
conn.request(method, url, **httplib_request_kw)
/usr/local/lib/python3.6/http/client.py:1239: in request
self._send_request(method, url, body, headers, encode_chunked)
/usr/local/lib/python3.6/http/client.py:1285: in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
/usr/local/lib/python3.6/http/client.py:1234: in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
/usr/local/lib/python3.6/http/client.py:1026: in _send_output
self.send(msg)
/usr/local/lib/python3.6/http/client.py:964: in send
self.connect()
/usr/local/lib/python3.6/site-packages/docker/transport/unixconn.py:43: in connect
sock.connect(self.unix_socket)
E urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
more-web-integration-tests/conftest.py:11: in pytest_runtest_setup
chrome = BrowserWebDriverContainer(DesiredCapabilities.CHROME).start()
/usr/local/lib/python3.6/site-packages/testcontainers/core/container.py:47: in start
volumes=self.volumes)
/usr/local/lib/python3.6/site-packages/testcontainers/core/docker_client.py:37: in run
**kwargs)
/usr/local/lib/python3.6/site-packages/docker/models/containers.py:785: in run
detach=detach, **kwargs)
/usr/local/lib/python3.6/site-packages/docker/models/containers.py:843: in create
resp = self.client.api.create_container(**create_kwargs)
/usr/local/lib/python3.6/site-packages/docker/api/container.py:427: in create_container
return self.create_container_from_config(config, name)
/usr/local/lib/python3.6/site-packages/docker/api/container.py:437: in create_container_from_config
res = self._post_json(u, data=config, params=params)
/usr/local/lib/python3.6/site-packages/docker/api/client.py:289: in _post_json
return self._post(url, data=json.dumps(data2), **kwargs)
/usr/local/lib/python3.6/site-packages/docker/utils/decorators.py:46: in inner
return f(self, *args, **kwargs)
/usr/local/lib/python3.6/site-packages/docker/api/client.py:226: in _post
return self.post(url, **self._set_request_timeout(kwargs))
/usr/local/lib/python3.6/site-packages/requests/sessions.py:581: in post
return self.request('POST', url, data=data, json=json, **kwargs)
/usr/local/lib/python3.6/site-packages/requests/sessions.py:533: in request
resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.6/site-packages/requests/sessions.py:646: in send
r = adapter.send(request, **kwargs)
/usr/local/lib/python3.6/site-packages/requests/adapters.py:498: in send
raise ConnectionError(err, request=request)
E requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
---------------------------- Captured stdout setup -----------------------------
Pulling image selenium/standalone-chrome-debug:latest
------------------------------ Captured log setup ------------------------------
conftest.py 10 INFO browser init
=========================== 26 error in 7.99 seconds ===========================
What's wrong with the code/configuration?
I couldn't find any information, except add something like VOLUME /var/run/docker.sock:/var/run/docker.sock to Dockerfile. That didn't help.
Hope that more details will help to figure out the problem.
and found a problem when i call chrome.get_driver() from the code above
-------------------------------- live log setup --------------------------------
conftest.py 10 INFO browser init
conftest.py 12 INFO browser downloaded
conftest.py 14 INFO get webdriver
remote_connection.py 117 INFO Could not connect to port 4444 on host 172.18.0.2
remote_connection.py 136 INFO Could not get IP address for host: 172.18.0.2
connectionpool.py 662 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23312adc18>: Failed to establish a new connection: [Errno 110] Operation timed out',)': /wd/hub/session
connectionpool.py 662 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23312a7ef0>: Failed to establish a new connection: [Errno 110] Operation timed out',)': /wd/hub/session
connectionpool.py 662 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23312a7550>: Failed to establish a new connection: [Errno 110] Operation timed out',)': /wd/hub/session
remote_connection.py 117 INFO Could not connect to port 4444 on host 172.18.0.2
remote_connection.py 136 INFO Could not get IP address for host: 172.18.0.2
connectionpool.py 662 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2331207780>: Failed to establish a new connection: [Errno 110] Operation timed out',)': /wd/hub/session
connectionpool.py 662 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23312070b8>: Failed to establish a new connection: [Errno 110] Operation timed out',)': /wd/hub/session
and this continues to spam.
May be this is new trouble for the new issue, but still blocks the same purpose: running test inside a container.
Need a help with understanding what happens here. What these hosts and ports mean?
having the same issue as described in the original request
errors like this one and the related ones urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
I ran into this error, not in a CI pipeline but on my laptop. For me the problem was that Docker Desktop wasn't running. After (re)starting Docker Desktop, the error went away.
Activity
aleksandr-kotlyar commentedon May 12, 2019
Hi, have the same issue.
Result: tests fail with errors, with such a log, as below.
Expected result: tests are running normally.
Requirements:
What's wrong with the code/configuration?
I couldn't find any information, except add something like
VOLUME /var/run/docker.sock:/var/run/docker.sockto Dockerfile. That didn't help.Hope that more details will help to figure out the problem.
Best regards, Aleksandr
aleksandr-kotlyar commentedon May 12, 2019
Hi, i have found guide how to use testcontainers in gitlab-ci.
https://www.testcontainers.org/supported_docker_environment/continuous_integration/gitlab_ci/
and found a problem when i call
chrome.get_driver()from the code aboveand this continues to spam.
May be this is new trouble for the new issue, but still blocks the same purpose: running test inside a container.
Need a help with understanding what happens here. What these hosts and ports mean?
Best regards, Aleksandr
tillahoffmann commentedon Apr 28, 2020
You should be able to use docker-in-docker given the changes in #66 and #85. Feel free to reopen if problems persist after the next release.
ahcub commentedon Jun 24, 2020
having the same issue as described in the original request
errors like this one and the related ones
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))not sure what is the issue as I added all the required things as per this doc: https://www.testcontainers.org/supported_docker_environment/continuous_integration/gitlab_ci/
pofl commentedon Aug 4, 2020
I ran into this error, not in a CI pipeline but on my laptop. For me the problem was that Docker Desktop wasn't running. After (re)starting Docker Desktop, the error went away.
tillahoffmann commentedon Aug 18, 2020
@ahcub, an example of a working
.gitlab-ci.ymlcan be found here. Does that help?ahcub commentedon Aug 21, 2020
yep, thanks