Cloned Ansible from github, now I have 'module' object has no attribute 'COLOER_ERROR'

115 views
Skip to first unread message

Joanna Delaporte

unread,
Mar 1, 2016, 4:32:58 PM3/1/16
to Ansible Project
When running ad-hoc ansible commands, I get the following error: 

$ ansible slackware-lab-64 -m setup

 [WARNING]: Error when using <bound method CallbackModule.v2_runner_on_failed of </home/ansible-user/ansible/lib/ansible/plugins/callback/minimal.CallbackModule object at 0x21d15d0>>: 'module' object has no attribute
'COLOR_ERROR'

I am also getting the ssh_split error whenever I try to run a playbook, so my Ansible is completely broken right now. 

Joanna Delaporte

unread,
Mar 1, 2016, 4:54:51 PM3/1/16
to Ansible Project
Fixed the typo in the subject. The ad-hoc commands are failing instantly after this error.

Arthur Reyes

unread,
Mar 1, 2016, 5:08:14 PM3/1/16
to Ansible Project
I noticed that this module isn't importing this module:

from ansible.utils.color import colorize, hostcolor

Arthur Reyes

unread,
Mar 1, 2016, 5:10:25 PM3/1/16
to Ansible Project
To be clear, in /ansible/lib/ansible/plugins/callback/minimal, there is no import of ansible.utils.color:

# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.callback import CallbackBase
from ansible import constants as C


class CallbackModule(CallbackBase):

Joanna Delaporte

unread,
Mar 1, 2016, 5:14:03 PM3/1/16
to Ansible Project
That sounds like a bug, then. Do you know where to report it? 

Matt Martz

unread,
Mar 1, 2016, 5:14:29 PM3/1/16
to ansible...@googlegroups.com
Based on this email and your other email about the ssh error, it looks like you are running a mismatched partially updated version of ansible.  I might recommend completely uninstalling and reinstalling ansible.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fd75c080-bdc7-49a3-9841-55cdba6e88cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

Arthur Reyes

unread,
Mar 1, 2016, 5:21:49 PM3/1/16
to Ansible Project
I would see if adding the allege missing line fixes the problem before reporting it as bug.  I don't know if I have the most current build, but that line is missing from my last pull:
$ ansible --version
ansible 2.1.0 (devel fb797a9e77) last updated 2016/01/22 14:23:55 (GMT -500)

Matt Martz

unread,
Mar 1, 2016, 5:28:51 PM3/1/16
to ansible...@googlegroups.com
In the minimal.py callback the reference is to C.COLOR_ERROR.  C comes from the 'from ansible import constants as C'

I can see `COLOR_ERROR` in constants.py.  If this error is happening, it would appear that the code is out of sync.


These changes were implemented on Dec 29.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Joanna Delaporte

unread,
Mar 1, 2016, 5:34:34 PM3/1/16
to Ansible Project
Hi Matt, 

I did the following: 

rm -rf ansible/
git clone git://github.com/ansible/ansible.git --recursive
cd ansible/
source hacking/env-setup

I did it again just now. I still get the same attribute 'COLOR_ERROR' when attempting ad-hoc commands and attribute split_ssh_args error when running playbooks.

What am I missing?
Thanks a ton for your input! I appreciate it.

Joanna

Joanna Delaporte

unread,
Mar 1, 2016, 5:39:20 PM3/1/16
to Ansible Project
Hi Arthur, 

When I run ansible --version, I get this:

$ ansible --version
ansible 2.1.0
  config file = /home/ansible-user/parkland/config/ansible.cfg
  configured module search path = Default w/o overrides

Matt Martz

unread,
Mar 1, 2016, 5:39:49 PM3/1/16
to ansible...@googlegroups.com
Do you have ansible installed anywhere else on that system?

What do you get when you run:

python -c "import sys; print sys.path"

You should see what is in your PYTHONPATH from using env-setup at the front after ''.  If not, then something could be inserting additional paths for python to search, and you could be grabbing files from incorrect locations.


For more options, visit https://groups.google.com/d/optout.

Joanna Delaporte

unread,
Mar 1, 2016, 5:46:13 PM3/1/16
to Ansible Project
It appears that I do have another installation as well. Grr. I'll ask pip to uninstall for me.

$ python -c "import sys; print sys.path"

['', '/usr/lib/python2.7/site-packages/ansible-2.1.0-py2.7.egg', '/home/ansible/ansible/lib', '/home/ansible/parkland', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages']

Joanna Delaporte

unread,
Mar 1, 2016, 5:49:38 PM3/1/16
to Ansible Project
Matt, I owe you a drink. 

sudo pip uninstall ansible removed the extra ansible installation. Now ansible functions again from the git clone. 

Thanks!
Joanna

Brian Coca

unread,
Mar 2, 2016, 9:21:33 AM3/2/16
to ansible...@googlegroups.com
run 'make clean' on the github repo, it seems you are mixing old files with the new code. You'll need to run . hacking/env-setup again.


----------
Brian Coca

Joanna Delaporte

unread,
Mar 2, 2016, 10:17:07 AM3/2/16
to Ansible Project
Hi Brian, 

Thanks! It turns out I had a system installation still hanging around in addition to the github clone. So, I pip uninstalled to remove the system installation of Ansible and now everything works again. 
Reply all
Reply to author
Forward
0 new messages