Molecule failing randomly on apt update #3035
-
Hola! I'm unable to get a consist experience when using Molecule to test out roles. For whatever reason, the same role passing today fails the next day by simply re-running it.
The only consistency is this failed task:
Login to the docker container and executing an apt update renders (which wasn't there initially)
Not sure what's happening here to cause this random error |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Have you tried doing a task to clean the cache right before your apt update task? I remember this being an issue others have dealt with. |
Beta Was this translation helpful? Give feedback.
-
What @larmbuster said and also re: "Not sure what's happening here to cause this random error" you need to search up containers and DNS, you might have local issues. |
Beta Was this translation helpful? Give feedback.
-
Issue resolved. Cause: DNS Fix https://www.ricmedia.com/set-permanent-dns-nameservers-ubuntu-debian-resolv-conf/ Alternative Fix: Pass dns_servers to container in molecule.yml like this. molecule.yml
Retrieve the DNS server you use with this command: Resources to understand why it happened: https://docs.docker.com/config/containers/container-networking/#dns-services Thank you team molecule for the replies, looking forward to using your product more! |
Beta Was this translation helpful? Give feedback.
What @larmbuster said and also re: "Not sure what's happening here to cause this random error" you need to search up containers and DNS, you might have local issues.