# ansible-playbook error using --su

**URL:** <https://forum.ansible.com/t/ansible-playbook-error-using-su/17266>\
**Category:** Ansible Project\
**Created:** [January 14, 2015, 4:29pm UTC](https://forum.ansible.com/t/ansible-playbook-error-using-su/17266 "2015-01-14T16:29:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kessia\_Pinheiro](https://avatars.discourse-cdn.com/v4/letter/k/e274bd/32.png) [@Kessia\_Pinheiro](https://forum.ansible.com/u/Kessia_Pinheiro)\
**Post date:** [January 14, 2015, 4:29pm UTC](https://forum.ansible.com/t/ansible-playbook-error-using-su/17266/1 "2015-01-14T16:29:37Z")

</div>

I’m trying to run a simple playbook (actually it’s another one, but I created that for tests), but it keep giving me the error below in any server I’ve tried:

`

---

<div class="post-metadata">

**Author:** ![David\_Moore](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@David\_Moore](https://forum.ansible.com/u/David_Moore)\
**Post date:** [January 28, 2015, 8:23pm UTC](https://forum.ansible.com/t/ansible-playbook-error-using-su/17266/2 "2015-01-28T20:23:08Z")

</div>

> I’m trying to run a simple playbook (actually it’s another one, but I created that for tests), but it keep giving me the error below in any server I’ve tried:  
> …
> 
> $ ansible-playbook test.yml -i production/inventory --user=inadmin --ask-pass --su --ask-su-pass -vvvv

…

> File “/usr/lib/python2.7/site-packages/ansible/runner/connection\_plugins/ssh.py”, line 337, in exec\_command  
> elif sudo\_errput.endswith(prompt):  
> TypeError: endswith first arg must be str, unicode, or tuple, not NoneType

I’ve just been struggling with the same problem. (using v 1.8.2).

What I have discovered is it is the extra verbose logging -vvvv that seems to cause the error. Try changing that to -vvv and see if it helps.
