# block/rescue is not rescuing ?

**URL:** <https://forum.ansible.com/t/block-rescue-is-not-rescuing/24014>\
**Category:** Ansible Project\
**Created:** [March 20, 2017, 11:43am UTC](https://forum.ansible.com/t/block-rescue-is-not-rescuing/24014 "2017-03-20T11:43:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_C1](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mike\_C1](https://forum.ansible.com/u/Mike_C1)\
**Post date:** [March 20, 2017, 11:43am UTC](https://forum.ansible.com/t/block-rescue-is-not-rescuing/24014/1 "2017-03-20T11:43:36Z")

</div>

Hi all,

im having trouble with the block/rescue functionality.

Here is my code:

```auto

- block:
- name: wget consul from artifactory
get_url:
url: '{{ consul_url }}'
checksum: 'sha256:{{ consul_sha256 }}'
dest: '{{ consul_home }}'
timeout: 5
register: downloaded_consul
rescue:
- name: wget consul to localhost
get_url:
url: '{{ consul_url }}'
checksum: 'sha256:{{ consul_sha256 }}'
dest: ./
register: wget_local
run_once: true
delegate_to: localhost
become: false

- name: copy zip file over
copy:
src: '{{ wget_local.dest }}'
dest: '{{ consul_home }}/'
register: copied_consul
tags:
- upgrade

- name: Extract consul executable files
unarchive:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
copy: false
with_items:
- src: '{{ consul_home }}/consul_{{ consul_version }}_linux_amd64.zip'
dest: '{{ consul_home }}'
when: (downloaded_consul|default({}))|changed or (copied_consul|default({}))|changed
register: consul_unarchive
tags:
- upgrade

```

so what i expect to happen is that if for some reason `wget consul from artifactory` does not complete for some hosts, it will execute the rescue block and download it locally and then upload it to the server.  
If i run that playbook, im getting:

```auto

TASK [consul : wget consul from artifactory] ***********************************
fatal: [server2]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}
fatal: [client1]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}
changed: [server1]
changed: [server3]

TASK [consul : Extract consul executable files] ********************************
changed: [server1] => (item={u'dest': u'/var/lib/consul', u'src': u'/var/lib/consul/consul_0.7.3_linux_amd64.zip'})
ok: [server2 -> localhost]

```

which completely skips the rescue block after `wget consul from artifactory` fails.

Any ideas on whats happening here ? Am i using block/rescue wrong ?

Cheers

```auto

ansible --version
ansible 2.2.0.0
configured module search path = Default w/o overrides

```
