ansible-community / ansible-community/molecule-plugins
The docker driver drops the error message when it fails to ping Docker
- Dominant language
- Python
- Stars
- 164
- Forks
- 113
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 1
Description
Hello,
I have an error in Gitlab-CI using docker-in-docker as a service. The driver is not able to ping the docker service but prints a generic error message without reporting the error message from the underlying docker library. This does not help solving the problem as there are many ways in which the connection can fail.
Reported error message: `Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon`
Error message from the underlying library (obtained using a one-line script in the same CI job): `[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: CA cert does not include key usage extension (_ssl.c:1032)'`
Please note I do not complain about this particular error, just the fact that I did not had any hint to start with.
It seems this occur in this except block: https://github.com/ansible-community/molecule-plugins/blob/main/src/molecule_plugins/docker/driver.py#L246
Would it possible to report the original message?
* docker server version: 27-dind
* molecule version: 25.11.1
* molecule-plugin version: 25.8.12
* docker library version: 7.1.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/molecule_plugins/docker/driver.py at the exception block around line 246, where Docker ping failures are reported. Trace the caught exception and verify that a failed ping exposes the underlying Docker library error as well as the existing guidance. Done means the original failure message is visible to users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100