# Ansible failed to complete successfully

**URL:** https://discourse.roots.io/t/ansible-failed-to-complete-successfully/5990
**Category:** trellis
**Created:** 2016-02-22T09:08:09Z
**Posts:** 29

## Post 1 by @Jonathan — 2016-02-22T09:08:09Z

HI,

Has anyone gotten this error when trying to vagrant up the example project?

ImportError: No module named compat.six  
Ansible failed to complete successfully. Any error output should be  
visible above. Please fix these errors and try again.

---

## Post 2 by @fullyint — 2016-02-22T09:19:16Z

I haven’t seen that error before. If it were me, I’d reinstall Ansible (current stable version as of Feb 22, 2016 is **2.0.0.2** – current version required forTrellis).

As I understand it, Ansible typically loads its [compat.six module](https://github.com/ansible/ansible/blob/e35b1cf1549c38fc9f81481ac14ff3077ddb3d07/lib/ansible/compat/six/_six.py) with “utilities for wrapping over differences between Python 2 and Python 3” ([ref](https://pythonhosted.org/six/)). If the module is not loading, there may be a problem with your Ansible installation.

If the problem persists after reinstalling Ansible, you might double-check that you are on the latest version of Vagrant.

---

## Post 3 by @Jonathan — 2016-02-22T09:51:53Z

Thanks, I reinstalled everything and got hit with this error when trying to vagrant up again. Sorry to come right back to you I’m a bit worn thin as I’ve been trying to get things working for a few days. I did have the development part working well for a few projects but now running into a lot of errors.

There was an error while executing `VBoxManage`, a CLI used by Vagrant  
for controlling VirtualBox. The command and stderr is shown below.

Command: [“hostonlyif”, “create”]

Stderr: 0%…  
Progress state: NS\_ERROR\_FAILURE  
VBoxManage: error: Failed to create the host-only adapter  
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory  
VBoxManage: error: Details: code NS\_ERROR\_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface  
VBoxManage: error: Context: “RTEXITCODE handleCreate(HandlerArg\*)” at line 71 of file VBoxManageHostonly.cpp

---

## Post 4 by @fullyint — 2016-02-22T10:16:50Z

It’s always frustrating to be working on fixing one error, only to have another pop up. Sad to hear it.

When I google “VBoxManage: error: Failed to create the host-only adapter” I think the [first result](http://stackoverflow.com/a/21363356) that pops up (first when I search, at least) will likely be helpful. Check out those results for tips on removing any other existing Virtualbox VMs that may be interfering (after trying to backup any data you may need on the VMs, if still possible).

You can also run `vagrant global-status` to see any Vagrant VMs existing on your machine. You could go `vagrant halt` those machines, or ultimately `destroy` them if the error persists.

---

## Post 5 by @Jonathan — 2016-02-22T10:18:28Z

> [@fullyint](#):
>
> first result

Hi thanks! I tried that command but it said command not found so I’ve been trying to figure out what could be wrong because it looks like that’s everyone’s solution to that problem too.

---

## Post 6 by @Twansparant — 2016-02-22T10:45:12Z

> [@Jonathan](#):
>
> command not found

You can always manually open Virtualbox from your applications and see what VM’s are running and stop them there and try again.

---

## Post 7 by @Jonathan — 2016-02-22T11:07:14Z

Hi, Thank you. I checked that and it said they were all off. I couldn’t find a place to restart in the gui. Is there a place to do that? Is it a wise idea to uninstall virtual box and reinstall or will that mess up the other boxes I have on the computer?

---

## Post 8 by @Twansparant — 2016-02-22T12:47:20Z

> [@Jonathan](#):
>
> Is there a place to do that

Yes, here (in dutch menu though):

 ![](https://discourse.roots.io/uploads/default/original/2X/e/e001fddc17fa4ceee315b5bc72f71c65c69a9076.png)

> [@Jonathan](#):
>
> Is it a wise idea to uninstall virtual box and reinstall or will that mess up the other boxes I have on the computer?

Shouldn’t be a problem, as long as your **VirtualBox VMs** folder with the .vbox files inside doesn’t get deleted (make a backup just in case). After fresh install you can re-add them.

---

## Post 9 by @Jonathan — 2016-02-23T05:48:22Z

Hi, Thanks for the help. I tried all of the above but still getting that error. Was it just virtual box that should be reinstalled?

---

## Post 10 by @Jonathan — 2016-02-23T06:14:15Z

Hi, When I sudo pip install ansible it installs version 1.9.4. I’m not seeing where to get the version 2.0.0.2 Thanks!

---

## Post 11 by @Twansparant — 2016-02-23T10:38:10Z

> [@Jonathan](#):
>
> I tried all of the above but still getting that error

Did you install the latest VirtualBox version **5.0.14**? And on which platform are you on? Mac OS X El Capitan?  
Also, to be sure you can use this Vagrant plugin to keep the VirtualBox guest additions up to date with your VB version: [GitHub - dotless-de/vagrant-vbguest: A Vagrant plugin to keep your VirtualBox Guest Additions up to date](https://github.com/dotless-de/vagrant-vbguest)

> [@Jonathan](#):
>
> I’m not seeing where to get the version 2.0.0.2

Hmm, that’s weird. Try: `sudo pip install ansible==2.0.0.2`  
Or you can always try installing the 2.0.0.2 version with the Tarball package: [http://releases.ansible.com/ansible/](http://releases.ansible.com/ansible/)

---

## Post 12 by @Jonathan — 2016-02-23T22:17:22Z

Thank you! I am back up and running with the example project working! Woohoo!

---

## Post 13 by @erit — 2016-02-26T06:12:31Z

Got the compat.six error on ansible 1.9.4, which, seems expected. Also got an error about setuptools when I tried updating ansible with the upgrade flag. Using `sudo pip install ansible==` and specifying the version works every time :fist::evergreen_tree:

---

## Post 14 by @silumesii — 2017-09-21T08:04:08Z

Hello!

I (accidentally) upgraded my version of `ansbile` on Ubuntu 16.04 Desktop this week. I am now on version 2.4.

```
$ ansible --version
ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/<username>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
```

Since the update, I can’t get Trellis to successfully deploy to development, staging or production.

The error I get running `vagrant up --provision` is:

```
ERROR! Unexpected Exception, this is probably a bug: No module named six
to see the full traceback, use -vvv
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
```

As far as I can tell, I have `six` installed.

Using apt:

```
$ dpkg -l | grep six
ii python-six 1.10.0-3 all Python 2 and 3 compatibility library (Python 2 interface)
ii python3-six 1.10.0-3 all Python 2 and 3 compatibility library (Python 3 interface)
```

Using pip:

```
$ pip list | grep six
six (1.10.0)
```

I stumbled on [this](https://github.com/ansible/ansible/issues/24628) issue on GitHub. Not sure if it is related.

Help?

---

## Post 15 by @fullyint — 2017-09-21T08:54:31Z

I’d suggest using pip to downgrade to Ansible 2.3.2.0:  
`pip install ansible==2.3.2.0`

Trellis compatibility with Ansible 2.4 has been proposed but not yet reviewed nor merged. If you’re inclined to test it, your feedback would be welcome!

> <https://github.com/roots/trellis/pull/895>

---

## Post 16 by @s3w47m88 — 2017-09-22T08:06:24Z

I’m experiencing this same issue.

I read this entire post, tried a few of the suggestions to no avail.

Right now I’m using Ansible 2.4.0.0 and when I try to downgrade to 2.3.2.0 I get an error:

> <https://gist.github.com/s3w47m88/0680b5334bf725b2e95f6a7fc205814e>

---

## Post 17 by @flocca — 2017-09-24T20:53:07Z

If you have installed Ansible via Homebrew, you can downgrade from 2.4.0.0 to 2.3.2.0\_1 with this command:

`brew remove ansible`

`brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/80a7570f27bbbd3fd57c3b8c4d176442584a2b95/Formula/ansible.rb`

---

## Post 18 by @fullyint — 2017-09-24T23:11:31Z

[roots/trellis#895](https://github.com/roots/trellis/pull/895) – Ansible 2.4 compatibility – has been merged.  
Note: Bumps Ansible requirement to 2.4.

---

## Post 19 by @smashlee — 2017-10-17T08:51:01Z

Has anybody found a solution to this?

I have recently upgraded to Ansible 2.4.0.0 and since then I have been unable to provision vagrant or provision or deploy to a remote server.

For a previous install of Trellis I downgraded Ansible to 2.3.2.0 which found success. However, I still have this issue for a new Trellis install.

---

## Post 20 by @ben — 2017-10-17T15:59:59Z

> [@Updated to Ansible 2.4, deploys broken, now what?](https://discourse.roots.io/t/updated-to-ansible-2-4-deploys-broken-now-what/10588):
>
> Much as I love Trellis sometimes I feel like I’ve missed an announcement. New Trellis install prompted me to update to Ansible 2.4, that’s fine, but now older projects won’t Provision/Deploy. Is there a guide to what exactly needs to be updated to correct this?

---

## Post 21 by @Simeon — 2017-10-17T23:18:05Z

I’ve found this to be good nudge to actually update Trellis on these sites…

---

## Post 22 by @markorapaic — 2017-10-25T00:24:56Z

Thats for the suggestion to downgrade to 2.3.2.0, this fixed it for me too.

---

## Post 23 by @MikePadge — 2017-12-26T17:34:53Z

Welp,

I guess I’ll dump my troubleshooting here since I have now joined this error boat.

TL:DR - Skip to bottom ====

> Updates to High Sierra (because I’m a masochist)  
> Same exact error

```
trellis/lib/trellis/plugins/filter/filters.py", line 8, in <module>
from ansible.compat.six import string_types
ImportError: No module named six
```

Digging into that file, this appears to be the specific offending line

```
from ansible.module_utils.six import iteritems
```

This seems like it could be an issue

```
python --version
Python 2.7.10
trellis casa$ ansible --version
ansible 2.4.2.0
  config file = /Users/casa/Documents/atom/Sites/AbilityDriven/trellis/ansible.cfg
  configured module search path = [u'/Users/casa/.ansible/plugins/modules', 
  u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 Compatible 
Apple LLVM 9.0.0 (clang-900.0.37)]
```

1. First thing I did was reinstall Ansible… No cigar

2. Brew has lovingly “updated” python’s default install and sync locations on MacOS from past behavior, which has caused several cluster\*\*\*\*s as far as Path is concerned on my system. (They had a legit reason for doing this, it just sucks).

So I’m not positive, but it looks like my python version is several updates behind Ansible’s. I’m not sure if I’m reading that correctly.

…

1. Fail: Setting path correctly w/ python at 2.7.14 did not fix this

=====================

Oh snap,

> <https://github.com/ansible/ansible/pull/24665/files>
>
> ##### SUMMARY
> - Make PEP8 compliant
> 
> ##### ISSUE TYPE
> 
> - Bugfix Pull Reque…st
> - Docs Pull Request
> 
> ##### COMPONENT NAME
> 
> module_utils/six
> 
> ##### ANSIBLE VERSION
> v2.4

@swalkinshaw  
@ben thoughts?

---

## Post 24 by @MikePadge — 2017-12-29T21:55:13Z

Derp city, somehow I still had old trellis code in my project. Updated to

newest version of Trellis resolved issues.

---

## Post 25 by @trainoasis — 2019-10-09T11:15:10Z

Had the same issue: reinstalled virtualbox via brew and then clicked “Allow” In System Preferences -\> Security & Privacy when it appears. Also had to kill all the running instances even after removing VirtualBox app from Applications. ps aux helps with that.

Then sadly after changing some settings and provisioning (or destroy + vagrant up again), another error pops up _sometimes_, but otherwise it seems the above fixed it for me on os x:

```
ERROR! Unexpected Exception, this is probably a bug: 'PlaybookCLI' object has no attribute 'options'
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
```

hmmph, so annoying to run into errors one after another indeed. Haven’t been able to get trellis working for months :slight_smile:

---

## Post 26 by @crypticsoft — 2019-10-13T21:04:18Z

I was also running into that same exception ‘PlaybookCLI’ object has no attribute ‘options’ when upgrading to the latest trellis v1.2.0. I had to revert the ansible version to v2.5.3 after trying out v2.8.5 and v2.7.12 respectively.

---

## Post 27 by @swalkinshaw — 2019-10-13T22:01:19Z

The `PlaybookCLI` error only happens in one situation: you’re using Ansible 2.8.x and _do not_ have a recent Trellis version with Ansible 2.8 support.

If you get that error after upgrading successfully to [https://github.com/roots/trellis/releases/tag/1.2.0](https://github.com/roots/trellis/releases/tag/1.2.0) then please open an issue.

---

## Post 28 by @trainoasis — 2019-10-14T06:47:44Z

Yeah I see the issue is in my Ansible version indeed - if I properly read the requirements from [https://github.com/roots/roots-example-project.com](https://github.com/roots/roots-example-project.com) I would have noticed before: it says Ansible should be `2.5.3-2.7.5`. Working with Trellis updated to latest master - 1.2.0!  
Thanks guys, @crypticsoft too for chiming in

---

## Post 29 by @swalkinshaw — 2019-10-15T01:37:45Z

I’m also locking this thread now. It’s been going on way too long and evolved into many unrelated issues to the original post.

---

## Post 30 by @swalkinshaw — 2019-10-15T01:37:50Z


