# Ansible expect module error

**URL:** <https://forum.ansible.com/t/ansible-expect-module-error/25907>\
**Category:** Ansible Project\
**Created:** [November 2, 2017, 8:10pm UTC](https://forum.ansible.com/t/ansible-expect-module-error/25907 "2017-11-02T20:10:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richmond\_Fiko](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Richmond\_Fiko](https://forum.ansible.com/u/Richmond_Fiko)\
**Post date:** [November 2, 2017, 8:10pm UTC](https://forum.ansible.com/t/ansible-expect-module-error/25907/1 "2017-11-02T20:10:52Z")

</div>

```auto
Hello,

```

```auto

```

```auto
I use Ansible 2.2.1.0

```

```auto
I try to use ansible expect module with a command:
    expect:
        command: set password of database
        responses:
            Admin Password for db_name: 'admin'
            Admin Password Confirmation: 'admin'

I receive this error:

fatal: [subdomain.xxxx.com]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Connection to sante.c3-bs.com closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 237, in <module>\r\n main()\r\n File \"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 149, in main\r\n response = u'%s\n' % value.rstrip('\n').decode()\r\nAttributeError: 'str' object has no attribute 'decode'\r\n", "msg": "MODULE FAILURE"}

I don't understand this error can someone help me and give me the right 
responses or right syntaxe for expect command?

```
