Unarchive faild with spring boot war archive

69 views
Skip to first unread message

Jan-Philipp Bolle

unread,
Mar 1, 2018, 2:25:14 AM3/1/18
to Ansible Project
Hi there

I try to unarchive several war archives. Mysteriously this fails only with war achives created by the maven spring boot plug-in (I expect this is the problem).
All my war achives can extract with the normal zip command.

I can reproduce this behavior with an ad-hoc command

ansible localhost -m unarchive -a "src=/home/pbolle/Downloads/webapp-2018.6-SNAPSHOT.war dest=/tmp"

The error message looks like

The full traceback is:
 
File "/tmp/ansible_jJlffO/ansible_module_unarchive.py", line 141, in <module>
   
from shlex import quote


localhost
| FAILED! => {
   
"changed": false,
   
"invocation": {
       
"module_args": {
           
"attributes": null,
           
"backup": null,
           
"content": null,
           
"creates": null,
           
"delimiter": null,
           
"dest": "/home/pbolle/temp",
           
"directory_mode": null,
           
"exclude": [],
           
"extra_opts": [],
           
"follow": false,
           
"force": null,
           
"group": null,
           
"keep_newer": false,
           
"list_files": false,
           
"mode": null,
           
"original_basename": "bpa-importer-infomaterial-2018.6-SNAPSHOT.war",
           
"owner": null,
           
"regexp": null,
           
"remote_src": false,
           
"selevel": null,
           
"serole": null,
           
"setype": null,
           
"seuser": null,
           
"src": "/home/pbolle/.ansible/tmp/ansible-tmp-1519888716.66-277418519655037/source",
           
"unsafe_writes": null,
           
"validate_certs": true
       
}
   
},
   
"msg": "Failed to find handler for \"/home/pbolle/.ansible/tmp/ansible-tmp-1519888716.66-277418519655037/source\". Make sure the required command to extract the file is installed. Command \"/bin/tar\" could not handle archive. Command \"/usr/bin/unzip\" could not handle archive."
}


Any idea how to solve the problem?
Is it possible to  debug the unarchive module?


Tank you and regards
Philipp

J Hawkesworth

unread,
Mar 1, 2018, 4:42:58 AM3/1/18
to Ansible Project
I suggest running a zipinfo -v on the .war file and on something else that will unarchive and see if you can isolate any differences.

Also I wonder if it is generating a 64bit zip file and perhaps your /usr/bin/unzip doesn't like that.

I found an old ant build on one of our projects that had zip64Mode="never" set on its zip task in order to make sure resultant zip task could also be deployed on 32 bit systems, so maybe something like that is a possibility too.

Hope this helps.

Jon

Jan-Philipp Bolle

unread,
Mar 1, 2018, 8:40:00 AM3/1/18
to Ansible Project
Hi Jon,

zipinfo was a good tip. The difference to a normal war is that a spring boot war has
“7932 extra bytes at beginning or within zipfile”

This is the reason for crashing the unarchive module.

I found a workaround for my problem. But I wondering why the  unarchive has a problem with the zip if the normal zip command has no problem.

Regards Philipp
Reply all
Reply to author
Forward
0 new messages