# Unarchive Module Failing with Return Code 11

**URL:** <https://forum.ansible.com/t/unarchive-module-failing-with-return-code-11/22004>\
**Category:** Ansible Project\
**Created:** [July 13, 2016, 9:23am UTC](https://forum.ansible.com/t/unarchive-module-failing-with-return-code-11/22004 "2016-07-13T09:23:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Barton](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@Stephen\_Barton](https://forum.ansible.com/u/Stephen_Barton)\
**Post date:** [July 13, 2016, 9:23am UTC](https://forum.ansible.com/t/unarchive-module-failing-with-return-code-11/22004/1 "2016-07-13T09:23:45Z")

</div>

Hi,

**Version:** 2.1.0.0

After a recent upgrade to the above version, I noticed that the unarchive module was failing with a return code of 11 (no matching files were found). So the line looked like this:

- name: Decompress Deployment Zip  
unarchive: copy=no src=“{{ temp\_dir }}/My.App.zip” dest=“{{ deploy\_dir }}”

But I got this:

inflating: /tmp/deploy/myapp/version \n", “rc”: 11}, “failed”: true, “gid”: 0, “group”: “root”, “handler”: “ZipArchive”, “invocation”: {“module\_args”: {“backup”: null, “content”: null, “copy”: false, “creates”: null, “delimiter”: null, “dest”: “/tmp/deploy/myapp”, “directory\_mode”: null, “exclude”: , “extra\_opts”: , “follow”: false, “force”: null, “group”: null, “keep\_newer”: false, “list\_files”: false, “mode”: null, “original\_basename”: “My.App.zip”, “owner”: null, “regexp”: null, “remote\_src”: null, “selevel”: null, “serole”: null, “setype”: null, “seuser”: null, “src”: “/tmp/My.App.zip”}}, “mode”: “0755”, “msg”: “failed to unpack /tmp/My.App.zip to /tmp/deploy/myapp”, “owner”: “root”, “secontext”: “unconfined\_u:object\_r:user\_tmp\_t:s0”, “size”: 4096, “src”: “/tmp/My.App.zip”, “state”: “directory”, “uid”: 0}

so I thought I would see if I got the same error using command and unzip:

- name: Decompress Deployment Zip  
command: /usr/bin/unzip -o “{{ temp\_dir }}/My.App.zip” -d “{{ deploy\_dir }}”

This worked as expected. The really weird thing is, if I THEN ran the unarchive module line, it worked once more.

So after doing some tests, I found that it did not matter if the destination directory existed, it was created by Ansible or created at the command line, unarchive gave this error. Until I ran unzip using the command module.

So my question is this, is this a bug? Or has the behaviour changed in some way?

Many Thanks,  
Stephen

---

<div class="post-metadata">

**Author:** ![Stuart\_Begg](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@Stuart\_Begg](https://forum.ansible.com/u/Stuart_Begg)\
**Post date:** [September 6, 2016, 4:04am UTC](https://forum.ansible.com/t/unarchive-module-failing-with-return-code-11/22004/2 "2016-09-06T04:04:32Z")

</div>

Hi, Stephen

I think I’m seeing a similar outcome. I suspect something has changed with the way unarchive works in more recent versions.

I have a playbook that has the following lines in it:

> ```auto
> - name: copy and unpack the artifacts to the host
> unarchive: src=../build/dist/jj.tar.gz dest=/home/users/sequation/www/documents/jj
> 
> ```

These lines **will work** with ansible version **2.0.1.0** (and before). But using 2.1.1.0, I get ansible telling me that there is no change and therefore nothing is unarchived.

In the case where it works and it doesn’t, the destination directory exists prior to running the playbook.

This has been very frustrating.

Have you found anything to shed light on your issue?

Cheers, S t u a r t .
