# MODULE FAILURE - Error in unarchive module (don't unarchive if file already exists)

**URL:** <https://forum.ansible.com/t/module-failure-error-in-unarchive-module-dont-unarchive-if-file-already-exists/21801>\
**Category:** Ansible Project\
**Created:** [June 17, 2016, 4:06pm UTC](https://forum.ansible.com/t/module-failure-error-in-unarchive-module-dont-unarchive-if-file-already-exists/21801 "2016-06-17T16:06:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Bornhoft](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@Jason\_Bornhoft](https://forum.ansible.com/u/Jason_Bornhoft)\
**Post date:** [June 17, 2016, 4:06pm UTC](https://forum.ansible.com/t/module-failure-error-in-unarchive-module-dont-unarchive-if-file-already-exists/21801/1 "2016-06-17T16:06:04Z")

</div>

I’m running the following with the intention of unarchiving a zip if the target file doesn’t exist while not running it if it does exist:

> > - name: Install Consul
> 
> > unarchive: creates=no
> 
> > copy=no
> 
> > src=/tmp/{{ consul\_ubuntu\_pkg }}
> 
> > dest=/usr/local/bin/
> 
> > owner={{ consul\_user }}
> 
> > group={{ consul\_group }} mode=0755

When I run the playbook I receive the following error:

> FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Killed by signal 1.\r\n”, “module\_stdout”: “Traceback (most recent call last):\r\n File "/tmp/ansible\_6QdEXT/ansible\_module\_unarchive.py", line 751, in \r\n main()\r\n File "/tmp/ansible\_6QdEXT/ansible\_module\_unarchive.py", line 711, in main\r\n check\_results = handler.is\_unarchived()\r\n File "/tmp/ansible\_6QdEXT/ansible\_module\_unarchive.py", line 397, in is\_unarchived\r\n err += ‘Path %s differs in permissions (%o vs %o)\n’ % (path, self.file\_args[‘mode’], stat.S\_IMODE(st.st\_mode))\r\nTypeError: %o format: a number is required, not str\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false, “stat”: {“exists”: false}}

Thanks in advance!
