Facing this error
def _retrieve_server_version(self):
try:
return self.version(api_version=False)["ApiVersion"]
except KeyError:
raise DockerException(
'Invalid response from docker daemon: key "ApiVersion"'
' is missing.'
)
except Exception as e:
INFO 2022-11-17 19:24:43,005 Done running pytest tests [tests_runner.py:run_pytest:79]
ERROR 2022-11-17 19:24:43,013 pytest exited with a nonzero exit code: 1 [tests_runner.py:run_pytest:83]
INFO 2022-11-17 19:24:43,020 Removing the test sidecar [live_cp_test.py:remove_sidecar:68]
WARNING 2022-11-17 19:24:45,752 Skipping 'prepare_artifacts', requires cloudbuild [live_cp_test.py:prepare_artifacts:74]
WARNING 2022-11-17 19:24:45,756 Skipping 'prepare_and_send_slack_update' (Requires cloudbuild) [live_cp_test.py:prepare_and_send_slack_update:97]
> raise DockerException(
f'Error while fetching server API version: {e}'
)
E docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
while I use pytest plugin called pytest-docker-compose:3.2.1
to run my services with docker-compose.
OS:MacOS monterey 12.6
docker version
Client:
Cloud integration: v1.0.29
Version: 20.10.21
API version: 1.41
Go version: go1.18.7
Git commit: baeda1f
Built: Tue Oct 25 18:01:18 2022
OS/Arch: darwin/amd64
Context: desktop-linux
Experimental: true
Server: Docker Desktop 4.14.1 (91661)
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.7
Git commit: 3056208
Built: Tue Oct 25 18:00:19 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.9
GitCommit: 1c90a442489720eec95342e1789ee8a5e1b9536f
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker-compose version.
Docker Compose version v2.12.2
This issue does not occur when docker is fresh installed, but once the system goes for a reboot I see this every time I use the pytest plugin.
command used to run the program.
docker run --env-file ./env.list -v /var/run/docker.sock:/var/run/docker.sock -v /Users/f/.config/gcloud:/root/.config/gcloud -v /Users/f/.docker:/root/.docker -v /Users/f/work/tests:/Users/f/work/tests --net=host -ti --rm test_image /Users/f/work/tests/run_in_docker bash -c '2>&1 make install && poetry run e2e live-cp-test --tests-path tests