# unable to use a remote node file in uri module

**URL:** <https://forum.ansible.com/t/unable-to-use-a-remote-node-file-in-uri-module/32230>\
**Category:** Ansible Project\
**Created:** [February 14, 2020, 4:16am UTC](https://forum.ansible.com/t/unable-to-use-a-remote-node-file-in-uri-module/32230 "2020-02-14T04:16:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishal\_Bobade](https://avatars.discourse-cdn.com/v4/letter/v/c57346/32.png) [@Vishal\_Bobade](https://forum.ansible.com/u/Vishal_Bobade)\
**Post date:** [February 14, 2020, 4:16am UTC](https://forum.ansible.com/t/unable-to-use-a-remote-node-file-in-uri-module/32230/1 "2020-02-14T04:16:41Z")

</div>

Hi,

below is my task where in the “body” section in the below task - I am currently using a file and it is throwing error (I actually check the location file is present there) when I am trying to run a jenkins job.

```auto
e[1;35m[WARNING]: Unable to find 'include/Browsers-CollectionDB.json' in expected paths (usee[0m

```

```auto
e[1;35m-vvvvv to see paths)e[0m
e[1;35me[0m
e[0;31mfatal: [10.181.56.199]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: 'include/Browsers-CollectionDB.json'"}e[0

```

However when I try to actually paste data from the file and specify it in “body :” it works.

```auto
            body: "{{ lookup('file','include/Browsers-CollectionDB.json') }}"

```

```auto
- name: Populating browsers collection
        uri:
            url: "http://{{groups['default'][0]}}:8529/_db/collectionDB/_api/document/browsers"
            HEADER_Content-Type: "application-type: json"
<b> body: "{{ lookup('file','include/Browsers-CollectionDB.json') }}"
</b> user: "{{ARANGODB_USER}}"
            password: "{{ARANGODB_PASS}}"
            method: POST
            force_basic_auth: yes
            status_code: 200

```

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [February 14, 2020, 9:19am UTC](https://forum.ansible.com/t/unable-to-use-a-remote-node-file-in-uri-module/32230/2 "2020-02-14T09:19:11Z")

</div>

> Hi,
> 
> below is my task where in the "body" section in the below task - I am currently using a file and it is throwing error (I  
> actually check the location file is present there) when I am trying to run a jenkins job.
> 
> [1;35m[WARNING]: Unable to find 'include/Browsers-CollectionDB.json' in expected paths (use [0m
> 
> [1;35m-vvvvv to see paths) [0m [1;35m [0m [0;31mfatal: [10.181.56.199]: FAILED! =\> {"msg": "An unhandled exception  
> occurred while running the lookup plugin 'file'. Error was a \<class 'ansible.errors.AnsibleError'\>, original message:  
> could not locate file in lookup: 'include/Browsers-CollectionDB.json'"} [0

1. The file is looked up on the controller, not on the target.

2. There is nothing wrong with following the advice above (-vvvvv to see paths).

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
