unarchive complaining about nonexistent file

173 views
Skip to first unread message

John Oliver

unread,
May 6, 2015, 2:59:37 PM5/6/15
to ansible...@googlegroups.com
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):
    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! :-P  I'm not sure if this is a bug or something on my end.

Yassen Damyanov

unread,
May 7, 2015, 11:23:43 AM5/7/15
to ansible...@googlegroups.com

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?

John Oliver

unread,
May 7, 2015, 2:24:47 PM5/7/15
to ansible...@googlegroups.com
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 :-P

Matt Martz

unread,
May 7, 2015, 3:18:23 PM5/7/15
to ansible...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/07603b7e-2c99-44df-b218-663f33fe8d92%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

John Oliver

unread,
May 7, 2015, 3:54:32 PM5/7/15
to ansible...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages