Ansible failed to complete successfully

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.

1 Like

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 with “utilities for wrapping over differences between Python 2 and Python 3” (ref). 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.

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

1 Like

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 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.

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.

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

1 Like

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?

Yes, here (in dutch menu though):

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.

3 Likes

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?

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!

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

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/

3 Likes

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

2 Likes

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:

1 Like

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 issue on GitHub. Not sure if it is related.

Help?

1 Like

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!

4 Likes

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:

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

2 Likes

roots/trellis#895 – Ansible 2.4 compatibility – has been merged.
Note: Bumps Ansible requirement to 2.4.

4 Likes

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.

2 Likes