# unarchive complaining about nonexistent file

**URL:** <https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174>\
**Category:** Ansible Project\
**Created:** [May 6, 2015, 6:59pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174 "2015-05-06T18:59:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 6, 2015, 6:59pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174/1 "2015-05-06T18:59:36Z")

</div>

ansible 1.9.0.1

- name: Untar DoD certificate installer  
unarchive: src=dod\_java\_certs.tgz dest=/tmp/ copy=yes

Results in:

TASK: [Untar DoD certificate installer] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [quad] =\> {“failed”: true, “parsed”: false}

BECOME-SUCCESS-jswerfsbfqzovzexvqbjpbabyvwuzibk  
Traceback (most recent call last):  
File “/Users/joliver.sa/.ansible/tmp/ansible-tmp-1430937098.81-30204202442133/unarchive”, line 1890, in   
main()  
File “/Users/joliver.sa/.ansible/tmp/ansible-tmp-1430937098.81-30204202442133/unarchive”, line 289, in main  
res\_args[‘changed’] = module.set\_fs\_attributes\_if\_different(file\_args, res\_args[‘changed’])  
File “/Users/joliver.sa/.ansible/tmp/ansible-tmp-1430937098.81-30204202442133/unarchive”, line 1090, in set\_fs\_attributes\_if\_different  
file\_args[‘path’], file\_args[‘mode’], changed  
File “/Users/joliver.sa/.ansible/tmp/ansible-tmp-1430937098.81-30204202442133/unarchive”, line 928, in set\_mode\_if\_different  
path\_stat = os.lstat(path)  
OSError: [Errno 2] No such file or directory: ‘/tmp/dod\_java\_certs/certs/.\_DODCA\_25.cer’  
Shared connection to quad closed.

I’ve filed a bug report for the traceback. ansible is correct… there is no such file as ‘certs/.\_DODCA\_25.cer’ in my tarball. There also isn’t a file called thisfiledoesnotexist, but I don’t get an error about that! 😛 I’m not sure if this is a bug or something on my end.

---

<div class="post-metadata">

**Author:** ![Yassen\_Damyanov](https://avatars.discourse-cdn.com/v4/letter/y/9fc29f/32.png) [@Yassen\_Damyanov](https://forum.ansible.com/u/Yassen_Damyanov)\
**Post date:** [May 7, 2015, 3:23pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174/2 "2015-05-07T15:23:43Z")

</div>

It tries to set permission mode to extracted files, does not find this one (/tmp/dod\_java\_certs/certs/.\_  
DODCA\_25.cer) and breaks, which means it expects it based on tar archive file list I guess.

I would suspect an incorrect / incomplete / broken tar archive.  
How about re-creating the archive and trying again with that?

---

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 7, 2015, 6:24pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174/3 "2015-05-07T18:24:47Z")

</div>

That’s the problem… there is no such file in the tarball. I can extract it manually just fine. So why does ansible believe that this file exists? It has to be getting that idea from somewhere, and I have to assume something broken in the ‘unarchive’ module, as it isn’t like tar is a new, unknown program full of bugs 😛

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 7, 2015, 7:17pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174/4 "2015-05-07T19:17:38Z")

</div>

Ansible performs the following command to find out what files the archive contains:

tar -tzf /path/to/archive.tgz

Based on that output, it attempts to set permissions for all files listed.

Your archive apparently lists a file that is not actually in the archive. This does’t affect unpacking, but by using that list, it affects the ability to set permissions on those files.

---

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [May 7, 2015, 7:54pm UTC](https://forum.ansible.com/t/unarchive-complaining-about-nonexistent-file/18174/5 "2015-05-07T19:54:32Z")

</div>

Ahh, thank you! Apple strikes again… these aren’t files, they’re resource forks. For posterity, export COPYFILE\_DISABLE=true before creating the tarball ought to fix this.
