-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Ansible randomly thinks apt command failed (either via the apt or the raw modules) #19128
Comments
We invoke /usr/bin/apt inside of the ansible module. When that command exits, it doesn't always include a helpful error message. Include the exit code so that user's have all the information we can gice them as to why apt failed. Addresses ansible#19128
Hello, I've had a chance to look into this and it looks like the problem is most likely in the packages you're trying to install. We only get this particular error message back when /usr/bin/apt-get returns a nonzero exit code to indicate failure. I notice that the last line in the stdout from apt is that it is processing triggers for ureadahead. My guess is that the trigger script sometimes fails and when that happens, it causes apt to fail out of its transaction. I've submitted a PR which will include the exit code from apt in the error message which will at least indicate that Ansible is failing because /usr/bin/apt-get failed. From apt-get's man page, I'm not sure that apt's return code is very useful (it seems to always return 100 on failure) but at least you'll know that something about how apt ran is causing the transient failures. |
We invoke /usr/bin/apt inside of the ansible module. When that command exits, it doesn't always include a helpful error message. Include the exit code so that user's have all the information we can gice them as to why apt failed. Addresses #19128
ISSUE TYPE
COMPONENT NAME
apt_module
, andapt
command via theraw_module
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Running on OS X 10.11.6, target host is a
minimal/xenial64
box in Vagrant, ansible run via Vagrant's ansible provisioner.SUMMARY
The apt module seems to think it failed, when it looks like it succeeded. It happens randomly, andI don't know how to reproduce. I also had this issue happen with my bootstrap python task (see below).
STEPS TO REPRODUCE
Run the tasks, and they will randomly fail, maybe once every 20 runs in my case.
EXPECTED RESULTS
Either the tasks to run without failures, or to fail with an actual failure.
ACTUAL RESULTS
The playbook run fails with the output below. I can't see any actual error in this output, it looks like a successful
apt
run.If I ssh into the box, the packages are installed, configured, and running just fine. If I then try to install any other package with
apt install foo
while sshed into the box, it installs fine too.If I
vagrant destroy -f && vagrant up
again, the playbook usually runs fine.The text was updated successfully, but these errors were encountered: