unarchive complaining about nonexistent file

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! :stuck_out_tongue: I’m not sure if this is a bug or something on my end.

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?

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 :stuck_out_tongue:

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.

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.