# Error downloading a 5 GB file with get\_url on http

**URL:** <https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103>\
**Category:** Ansible Project\
**Created:** [August 22, 2019, 5:34pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103 "2019-08-22T17:34:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Cure](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@Daniel\_Cure](https://forum.ansible.com/u/Daniel_Cure)\
**Post date:** [August 22, 2019, 5:34pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/1 "2019-08-22T17:34:20Z")

</div>

Good afternoon dear contributors of ansible. Thank you very much for your kindly answer.

I have a situation with a playbook, which takes the following error when the task of downloading a 5GB file runs:

**after some minutes running the task it shows:**

fatal: [10.x.x.x]: UNREACHABLE! =\> {“changed”: false, “msg”: “Failed to connect to the host via ssh: Shared connection to 10.8.137.184 closed.”, “unreachable”: true}

For the above I modify the config file and add the following:

[persistent\_connection]

# Configures the persistent connection timeout value in seconds. This value is

# how long the persistent connection will remain idle before it is destroyed.

# If the connection doesn’t receive a request before the timeout value

# expires, the connection is shutdown. The default value is 30 seconds.

**connect\_timeout = 1800**

# Configures the persistent connection retry timeout. This value configures the

# the retry timeout that ansible-connection will wait to connect

# to the local domain socket. This value must be larger than the

# ssh timeout (timeout) and less than persistent connection idle timeout (connect\_timeout).

# The default value is 15 seconds.

#connect\_retry\_timeout = 15

# The command timeout value defines the amount of time to wait for a command

# or RPC call before timing out. The value for the command timeout must

# be less than the value of the persistent connection idle timeout (connect\_timeout)

# The default value is 10 second.

**command\_timeout = 180** 0

First question: Is this okay what I did?

second question: after this change

I got the following error (different ):

The full traceback is:  
Traceback (most recent call last):  
File “/tmp/ansible\_get\_url\_payload\_QyeZwG/ **main**.py”, line 390, in url\_get  
shutil.copyfileobj(rsp, f)  
File “/usr/lib64/python2.7/shutil.py”, line 52, in copyfileobj  
fdst.write(buf)  
**IOError: [Errno 28] No space left on device**

fatal: [10.8.137.184]: FAILED! =\> {  
“changed”: false,  
“elapsed”: 0,  
“invocation”: {  
“module\_args”: {  
“attributes”: null,  
“backup”: null,  
“checksum”: “”,  
“client\_cert”: null,  
“client\_key”: null,  
“content”: null,  
“delimiter”: null,  
“dest”: “/oracle/Instaladores/”,  
“directory\_mode”: null,  
“follow”: false,  
“force”: false,  
“force\_basic\_auth”: false,  
“group”: null,  
“headers”: null,  
“http\_agent”: “ansible-httpget”,  
“mode”: null,  
“owner”: null,  
“regexp”: null,  
“remote\_src”: null,  
“selevel”: null,  
“serole”: null,  
“setype”: null,  
“seuser”: null,  
“sha256sum”: “”,  
“src”: null,  
“timeout”: 10,  
“tmp\_dest”: null,  
“unsafe\_writes”: null,  
“url”: “[http://10.8.70.41/ORACLE\_DB/Instaladores\_18C/LINUX.X64\_180000\_grid\_home.zip](http://10.8.70.41/ORACLE_DB/Instaladores_18C/LINUX.X64_180000_grid_home.zip)”,  
“url\_password”: null,  
“url\_username”: null,  
“use\_proxy”: true,  
“validate\_certs”: true  
}  
},  
**“msg”: “failed to create temporary content file: [Errno 28] No space left on device”**

But in the managed node i have space in tmp and in the destiny directory:

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/SYS-tmp 10G 34M 10G 1% /tmp

/dev/mapper/DATA-lv\_oracle 50G 33M 50G 1% /oracle

so what do you think what it could be ?

Thank you so much

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 22, 2019, 9:44pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/2 "2019-08-22T21:44:44Z")

</div>

Your file is being put in a different temporary directory first, i.e  
not in /oracle or /tmp.  
What is the full list of filesystems on that host?

---

<div class="post-metadata">

**Author:** ![Daniel\_Cure](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@Daniel\_Cure](https://forum.ansible.com/u/Daniel_Cure)\
**Post date:** [August 22, 2019, 10:19pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/3 "2019-08-22T22:19:48Z")

</div>

Hi Dick how are you ?

Thank you for you response.

I realized after putting the post that does in the home of the user who connects ansible a thousand thanks for helping me. Now I have another problem running a very long task (running a script that lasts between 1 hour and 1 hour and a half), the task takes the following error (the same error):

| 

**task path: /home/“user”/orc2.yml:56**

 |
| 

\<xx.xx.xx.xx\> ESTABLISH SSH CONNECTION FOR USER: “user”

 |
| 

\<xx.xx.xx.xx\> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’“‘echo ~“user” && sleep 0’”’"‘’

 |
| 

\<xx.xx.xx.xx\> (0, ‘/home/“user”\n’, ‘’)

 |
| 

\<xx.xx.xx.xx\> ESTABLISH SSH CONNECTION FOR USER: “user”

 |
| 

\<xx.xx.xx.xx\> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “`echo /home/"user"/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266`” && echo ansible-tmp-1566509476.54-174156054247266=“`echo /home/"user"/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266`” ) && sleep 0’“'”‘’

 |
| 

\<xx.xx.xx.xx\> (0, ‘ansible-tmp-1566509476.54-174156054247266=/home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266\n’, ‘’)

 |
| 

Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py

 |
| 

\<xx.xx.xx.xx\> PUT /root/.ansible/tmp/ansible-local-4406071GcMlt/tmpbaJE2Y TO /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ\_command.py

 |
| 

\<xx.xx.xx.xx\> SSH: EXEC sshpass -d8 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 ‘[xx.xx.xx.xx]’

 |
| 

\<xx.xx.xx.xx\> (0, ‘sftp\> put /root/.ansible/tmp/ansible-local-4406071GcMlt/tmpbaJE2Y /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ\_command.py\n’, ‘’)

 |
| 

\<xx.xx.xx.xx\> ESTABLISH SSH CONNECTION FOR USER: “user”

 |
| 

\<xx.xx.xx.xx\> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 xx.xx.xx.xx ‘/bin/sh -c ‘"’“‘chmod u+x /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/ /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ\_command.py && sleep 0’”’"‘’

 |
| 

\<xx.xx.xx.xx\> (0, ‘’, ‘’)

 |
| 

\<xx.xx.xx.xx\> ESTABLISH SSH CONNECTION FOR USER: “user”

 |
| 

\<xx.xx.xx.xx\> SSH: EXEC sshpass -d8 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘User=““user””’ -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/556bc6aa24 -tt xx.xx.xx.xx ‘/bin/sh -c ‘"’“'sudo -H -S -n -u root /bin/sh -c '”’“'”‘"’“'”‘"’“‘echo BECOME-SUCCESS-uenhiefkacvemgvpzjilhutpwqostcuo ; /usr/bin/python /home/“user”/.ansible/tmp/ansible-tmp-1566509476.54-174156054247266/AnsiballZ\_command.py’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’

 |
| |
| 

**\<xx.xx.xx.xx\> (255, ‘BECOME-SUCCESS-uenhiefkacvemgvpzjilhutpwqostcuo\r\n’, ‘Shared connection to xx.xx.xx.xx closed.\r\n’)**

 |
| 

**fatal: [xx.xx.xx.xx]: UNREACHABLE! =\> {**

 |
| 

**“changed”: false,**

 |
| 

**“msg”: “Failed to connect to the host via ssh: Shared connection to xx.xx.xx.xx closed.”,**

 |
| 

**“unreachable”: true**

**This is how the tasj is defined .**

 | 
- name: Ejecutar script oracle

command: cd /oracle/scripts/ ; ./InstalarOracle.sh \> /oracle/scripts/InstalarOracle.log  
async: 10800

Any help ?

thank you so much

 | |

---

<div class="post-metadata">

**Author:** ![Daniel\_Cure](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@Daniel\_Cure](https://forum.ansible.com/u/Daniel_Cure)\
**Post date:** [August 22, 2019, 10:22pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/4 "2019-08-22T22:22:14Z")

</div>

This is how task is implemented :

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 22, 2019, 10:23pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/5 "2019-08-22T22:23:13Z")

</div>

Use async  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_async.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 22, 2019, 10:29pm UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/6 "2019-08-22T22:29:45Z")

</div>

You can't use semicolon or redirect with the command module, you need to switch to shell module.

---

<div class="post-metadata">

**Author:** ![Daniel\_Cure](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@Daniel\_Cure](https://forum.ansible.com/u/Daniel_Cure)\
**Post date:** [August 25, 2019, 5:41am UTC](https://forum.ansible.com/t/error-downloading-a-5-gb-file-with-get-url-on-http/31103/7 "2019-08-25T05:41:43Z")

</div>

Hello dear Kai

Thak you so much for your kindly help.
