{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11348","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11348/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11348/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11348/events","html_url":"https://github.com/ansible/ansible/issues/11348","id":90178262,"number":11348,"title":"bug in unarchive module","user":{"login":"pescobar","id":103797,"avatar_url":"https://avatars.githubusercontent.com/u/103797?v=3","gravatar_id":"","url":"https://api.github.com/users/pescobar","html_url":"https://github.com/pescobar","followers_url":"https://api.github.com/users/pescobar/followers","following_url":"https://api.github.com/users/pescobar/following{/other_user}","gists_url":"https://api.github.com/users/pescobar/gists{/gist_id}","starred_url":"https://api.github.com/users/pescobar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pescobar/subscriptions","organizations_url":"https://api.github.com/users/pescobar/orgs","repos_url":"https://api.github.com/users/pescobar/repos","events_url":"https://api.github.com/users/pescobar/events{/privacy}","received_events_url":"https://api.github.com/users/pescobar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P2","name":"P2","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-06-22T18:45:46Z","updated_at":"2016-03-04T21:02:09Z","closed_at":"2015-07-21T02:47:47Z","body":"Hi\r\n\r\nI have found a problem with the unarchive module when the file to uncompress contains \"weird\" characters. With this playbook the problem can be reproduced:\r\n\r\n```\r\n---\r\n\r\n- name: reproduce the unarchive bug\r\n  hosts: 127.0.0.1\r\n  connection: local\r\n\r\n  tasks:\r\n  - name: Download LMOD\r\n    get_url:\r\n      url=https://github.com/TACC/Lmod/archive/6.0.4.tar.gz\r\n      dest=/tmp/\r\n      mode=0644\r\n      validate_certs=no\r\n\r\n  - name: Uncompress LMOD\r\n    unarchive: src=/tmp/Lmod-6.0.4.tar.gz dest=/tmp copy=no mode=0644\r\n```\r\n\r\nAnd this is the output when executing it:\r\n\r\n```\r\nroot@mgmt05 /tmp # ansible-playbook unarchive-bug.yml\r\n\r\nPLAY [reproduce the unarchive bug] ********************************************\r\n\r\nGATHERING FACTS ***************************************************************\r\nok: [127.0.0.1]\r\n\r\nTASK: [Download LMOD] *********************************************************\r\nok: [127.0.0.1]\r\n\r\nTASK: [Uncompress LMOD] *******************************************************\r\nfailed: [127.0.0.1] => {\"failed\": true, \"parsed\": false}\r\nTraceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1434998674.55-80965098747038/unarchive\", line 1895, in <module>\r\n    main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1434998674.55-80965098747038/unarchive\", line 289, in main\r\n    res_args['changed'] = module.set_fs_attributes_if_different(file_args, res_args['changed'])\r\n  File \"/root/.ansible/tmp/ansible-tmp-1434998674.55-80965098747038/unarchive\", line 1090, in set_fs_attributes_if_different\r\n    file_args['path'], file_args['mode'], changed\r\n  File \"/root/.ansible/tmp/ansible-tmp-1434998674.55-80965098747038/unarchive\", line 928, in set_mode_if_different\r\n    path_stat = os.lstat(path)\r\nOSError: [Errno 2] No such file or directory: '/tmp/Lmod-6.0.4/contrib/Presentations/Keynote_Lmod_SC14-Calcul_Que\\\\314\\\\201bec_experience.pdf'\r\n\r\n\r\nFATAL: all hosts have already failed -- aborting\r\n\r\nPLAY RECAP ********************************************************************\r\n           to retry, use: --limit @/root/unarchive-bug.retry\r\n\r\n127.0.0.1                  : ok=2    changed=0    unreachable=0    failed=1\r\n```\r\nthe file can be uncompressed without issues using \"tar\" directly in the command line or using the ansible shell module to call \"tar\". This is the file name which triggers the error:\r\n```\r\nKeynote_Lmod_SC14-Calcul_Québec_experience.pdf\r\n```\r\nI have found this issue with ansible 1.9.1\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/192465697","html_url":"https://github.com/ansible/ansible/issues/11348#issuecomment-192465697","issue_url":"https://api.github.com/repos/ansible/ansible/issues/11348","id":192465697,"user":{"login":"odyssey4me","id":2152106,"avatar_url":"https://avatars.githubusercontent.com/u/2152106?v=3","gravatar_id":"","url":"https://api.github.com/users/odyssey4me","html_url":"https://github.com/odyssey4me","followers_url":"https://api.github.com/users/odyssey4me/followers","following_url":"https://api.github.com/users/odyssey4me/following{/other_user}","gists_url":"https://api.github.com/users/odyssey4me/gists{/gist_id}","starred_url":"https://api.github.com/users/odyssey4me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odyssey4me/subscriptions","organizations_url":"https://api.github.com/users/odyssey4me/orgs","repos_url":"https://api.github.com/users/odyssey4me/repos","events_url":"https://api.github.com/users/odyssey4me/events{/privacy}","received_events_url":"https://api.github.com/users/odyssey4me/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T21:02:09Z","updated_at":"2016-03-04T21:02:09Z","body":"We recently encountered this with Ansible 1.9.4-1 and discovered that the issue came down to the archive containing file/folder names with unicode characters, and the host doing the unarchive couldn't deal with them. The host was Ubuntu 14.04 and the issue was resolved by installing the package 'language-pack-en' on the host."}}