# Response' object has no attribute '\_\_getitem\_\_ while running the lookup plugin 'hashi\_vault'

**URL:** <https://forum.ansible.com/t/response-object-has-no-attribute-getitem-while-running-the-lookup-plugin-hashi-vault/32983>\
**Category:** Ansible Project\
**Created:** [May 20, 2020, 10:02am UTC](https://forum.ansible.com/t/response-object-has-no-attribute-getitem-while-running-the-lookup-plugin-hashi-vault/32983 "2020-05-20T10:02:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asmitha\_j.s](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Asmitha\_j.s](https://forum.ansible.com/u/Asmitha_j.s)\
**Post date:** [May 20, 2020, 10:02am UTC](https://forum.ansible.com/t/response-object-has-no-attribute-getitem-while-running-the-lookup-plugin-hashi-vault/32983/1 "2020-05-20T10:02:15Z")

</div>

I’m using hashi\_vault to retrieve secrets from HashiCorp’s vault in ansible playbook.

`

- name: Return all secrets from a path  
set\_fact:  
vault\_result: “{{ lookup(‘hashi\_vault’, ‘secret=secret/key:value token=token url=[https://vaultaddress/ui/vault/secrets/secret/list/folder/subfolder/environment/](https://vaultaddress/ui/vault/secrets/secret/list/folder/subfolder/environment/)’)}}”

tags:

- vault  
`

command i’m using to run pl is ansible-playbook -v plybook.yml --tags vault

I’m getting following error:  
`fatal: [server_addr]: FAILED! => { "msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <type 'exceptions.TypeError'>, original message: 'Response' object has no attribute ' __getitem__'" }`

`My python version is Python 2.7.5 My pip versin is pip 20.1 My Ansible version is ansible 2.9.3 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/asmithas/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]`

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [May 20, 2020, 6:29pm UTC](https://forum.ansible.com/t/response-object-has-no-attribute-getitem-while-running-the-lookup-plugin-hashi-vault/32983/2 "2020-05-20T18:29:36Z")

</div>

Have you installed pip hashi vault module . I think you have to install the pip module for this connection. Check in hashi vault module page in official ansible document . In first few line you can see the requirements. Fix that it will work .

---

<div class="post-metadata">

**Author:** ![Asmitha\_j.s](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Asmitha\_j.s](https://forum.ansible.com/u/Asmitha_j.s)\
**Post date:** [May 21, 2020, 7:27am UTC](https://forum.ansible.com/t/response-object-has-no-attribute-getitem-while-running-the-lookup-plugin-hashi-vault/32983/3 "2020-05-21T07:27:46Z")

</div>

I’m refering to [https://docs.ansible.com/ansible/latest/plugins/lookup/hashi\_vault.html](https://docs.ansible.com/ansible/latest/plugins/lookup/hashi_vault.html) document. It requires hvac (python library). and i have already installed it. Im trying connect by github token.
