msg = unicode(msg).encode('utf8') LookupError

200 views
Skip to first unread message

Nic Flores

unread,
Jun 20, 2014, 5:28:48 PM6/20/14
to ansible...@googlegroups.com
Hi All,

I'm seeing the following error:

When I run the following command:

ansible my_server -i sdc_hosts -m ping -u ansible --ask-pass

against a server running:

myserver$ python --version
Python 2.6.6


myserver | FAILED >> {
    "failed": true,
    "msg": "Traceback (most recent call last):\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1403299259.38-79129513838413/command\", line 1383, in <module>\n    main()\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1403299259.38-79129513838413/command\", line 91, in main\n    module = CommandModule(argument_spec=dict())\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1403299259.38-79129513838413/command\", line 382, in __init__\n    self._log_invocation()\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1403299259.38-79129513838413/command\", line 974, in _log_invocation\n    msg = unicode(msg).encode('utf8')\nLookupError: no codec search functions registered: can't find encoding\n",
    "parsed": false
}

Does anyone have an idea as to what my be causing this?

Michael DeHaan

unread,
Jun 20, 2014, 5:31:17 PM6/20/14
to ansible...@googlegroups.com
Hi Nick,

Can we get a quick check of what "ansible --version" says?



--
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/25aeecf8-eaaf-4b4e-b71c-3279611dd658%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nic Flores

unread,
Jun 20, 2014, 5:54:29 PM6/20/14
to ansible...@googlegroups.com
Here you go:

ansible 1.6 (devel a37a84243b) last updated 2014/04/16 17:45:50 (GMT +000)


Nic

Michael DeHaan

unread,
Jun 21, 2014, 12:49:09 PM6/21/14
to ansible...@googlegroups.com
You're three dot releases back - see if this occurs in 1.6.3 if you don't mind - and file a bug if it does.






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

Nic Flores

unread,
Jun 23, 2014, 4:52:31 PM6/23/14
to ansible...@googlegroups.com
I just did a git clone and I am now running the following version of ansible

-bash-4.1$ ansible --version
ansible 1.7 (devel f8bf9cdeec) last updated 2014/06/23 20:27:32 (GMT +000):

and now I get a different error:

-bash-4.1$ ansible myserver -i ../inventory/hosts -m ping -u ansible --ask-pass
SSH password:

my server | FAILED >> {
    "failed": true,
    "msg": "Traceback (most recent call last):\n  File \"/home/ansible/.ansible/tmp/ansible-tmp-1403556652.28-139660901347999/ping\", line 97, in <module>\n    import locale\n  File \"/usr/lib64/python2.6/locale.py\", line 14, in <module>\nImportError: No module named encodings\n",
    "parsed": false
}

any thoughts?

James Cammarata

unread,
Jun 24, 2014, 9:34:30 AM6/24/14
to ansible...@googlegroups.com
The exception you're seeing is coming from inside a python-distributed package, so this would seem to be a python pathing problem. Do you have multiple versions of python installed, and/or did you install python from source? 


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

Nic Flores

unread,
Jun 25, 2014, 2:53:16 PM6/25/14
to ansible...@googlegroups.com
James,
Thanks for pinning this down for me. I'll look into how python was installed on the server. At least now I know the problem is now on the server side and not on the ansible side.
Reply all
Reply to author
Forward
0 new messages