Thanks again for your reply Toshio. I apologize for not getting back to you 
sooner, was off of work for a week and a half. While I was gone, one of my 
fellow sysadmins updated ansible to 1.9.3, so I am now able to test the 
failing playbook in production. Once I get up to speed with everything and 
have a chance to check, I'll post back here if I'm still having issues. 
Let's hope 1.9.3 fixed the problem :)

Gene

On Thursday, September 3, 2015 at 12:14:53 AM UTC-5, tkuratomi wrote:
>
> Not a lot to go on... I do see that the two errors are happening in 
> different places.  That might be bad news for you as may mean that any 
> fix for 1.9.3 might not be the fix needed for 1.7.2.  But let's see 
> what we can find: 
>
> On Wed, Sep 2, 2015 at 3:41 PM, Eugene Romero <[email protected] 
> <javascript:>> wrote: 
>
> > 
> > TASK: [syslog-client | Stop the syslog-ng service before upgrading to 
> > upstart] *** 
> > Traceback (most recent call last): 
> >   File "/usr/bin/ansible-playbook", line 324, in <module> 
> >     sys.exit(main(sys.argv[1:])) 
> >   File "/usr/bin/ansible-playbook", line 264, in main 
> >     pb.run() 
> >   File "/usr/lib/pymodules/python2.7/ansible/playbook/__init__.py", line 
> > 348, in run 
> >     if not self._run_play(play): 
> >   File "/usr/lib/pymodules/python2.7/ansible/playbook/__init__.py", line 
> > 789, in _run_play 
> >     if not self._run_task(play, task, False): 
> >   File "/usr/lib/pymodules/python2.7/ansible/playbook/__init__.py", line 
> > 497, in _run_task 
> >     results = self._run_task_internal(task, 
> include_failed=include_failed) 
> >   File "/usr/lib/pymodules/python2.7/ansible/playbook/__init__.py", line 
> > 439, in _run_task_internal 
> >     results = runner.run() 
> >   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 
> 1493, 
> > in run 
> >     results = [ self._executor(h, None) for h in hosts ] 
> >   File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 
> 590, 
> > in _executor 
> >     msg = str(ae) 
> > UnicodeEncodeError: 'ascii' codec can't encode characters in position 
> 40-41: 
> > ordinal not in range(128) 
> > 
>
> This is an error when trying to format this exception into a string 
> for display.  We can probably just substitute that line like this: 
>
> - msg = str(ae) 
> + from ansible.utils.unicode import to_bytes 
> + msg = to_bytes(ae) 
>
> That should solve this traceback but the fact we're getting an 
> exception there means that something else has gone wrong... It could 
> be something that you're expected to be able to handle by changing 
> configuration in your network though, so doing this so that you can 
> see what the actual error is should be helpful. 
>
> If we're lucky, once you see what the underlying error is here, you 
> can correct something else on your network and then 1.7.2 will run for 
> you as well. 
>
> I'll add a patch to the stable-1.9 tree to do this as well.  Not sure 
> if it will make 1.9.3 or not, though. 
>
>
> https://github.com/ansible/ansible/commit/f80494e434d36c1845c9fb830b6bd26ebcf35a89
>  
>
> >> >> fatal: [******] => Traceback (most recent call last): 
> >> >>   File 
> "/usr/lib/python2.7/dist-packages/ansible/runner/__init__.py", 
> >> >> line 
> >> >> 561, in _executor 
> >> >>     exec_rc = self._executor_internal(host, new_stdin) 
> >> >>   File 
> "/usr/lib/python2.7/dist-packages/ansible/runner/__init__.py", 
> >> >> line 
> >> >> 666, in _executor_internal 
> >> >>     return self._executor_internal_inner(host, self.module_name, 
> >> >> self.module_args, inject, port, complex_args=complex_args) 
> >> >>   File 
> "/usr/lib/python2.7/dist-packages/ansible/runner/__init__.py", 
> >> >> line 
> >> >> 756, in _executor_internal_inner 
> >> >>     if not utils.check_conditional(cond, self.basedir, inject, 
> >> >> fail_on_undefined=self.error_on_undefined_vars): 
> >> >>   File "/usr/lib/python2.7/dist-packages/ansible/utils/__init__.py", 
> >> >> line 
> >> >> 255, in check_conditional 
> >> >> 
> >> >> UnicodeEncodeError: 'ascii' codec can't encode characters in 
> position 
> >> >> 15-16: ordinal not in range(128) 
>
> 1.7.2 is old and I'm not sure of some of the ramifications of making 
> changes in the code (in newer versions of ansible we've been moving 
> towards making sure that internally we handle everything as unicode 
> strings and only using bytes when sending things externally.  In 1.7.2 
> we weren't doing that so most things were likely byte strings.  jinja2 
> takes and returns unicode type, however, so that's likely why we have 
> a problem converting from what jinja2 is returning to us here.) but we 
> may be able to fix this with the following code change: 
>
> - original = str(conditional).replace("jinja2_compare ","") 
> + tmp_conditional = to_bytes(conditional, 
> errors='strict').replace("jinja2_compare ","") 
> + original = tmp_conditional.replace("jinja2_compare ","") 
>
> Not sure if that will just bring us another error, further down the 
> line, though. 
>
> -Toshio 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/68615776-14da-40fc-8156-da6eec3eed03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to