Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_copy does not support large files #32677

Closed
u625030 opened this issue Nov 8, 2017 · 2 comments · Fixed by #32682
Closed

win_copy does not support large files #32677

u625030 opened this issue Nov 8, 2017 · 2 comments · Fixed by #32682
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community

Comments

@u625030
Copy link
Contributor

u625030 commented Nov 8, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_copy

ANSIBLE VERSION
ccbm@amslabweb03.uniface.m4.local> ansible --version
ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/h/CCbm/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
CONFIGURATION

DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = [u'/etc/ansible/roles', u'/usr/share/ansible/roles']

OS / ENVIRONMENT

N/A (Linux XXXXXXXXXXX.XXXXXXX.XX.XXXXX 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
)

SUMMARY

win_copy by default does not use large file support when building a ZIP file that needs to be transferred.
When doing a copy of a file larger than 4 Gb, this results in an error.

STEPS TO REPRODUCE
  - name: Copy Visual Studio installer to local machine
    win_copy:
      src: /cwnl/common/software/microsoft/VisualStudio_2015
      dest: C:\Temp\BuildMachineTemp\
EXPECTED RESULTS

File copy should work without problems

ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/win_copy.py", line 290, in _copy_zip_file
    zip_file = self._create_zip_tempfile(files, directories)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/action/win_copy.py", line 252, in _create_zip_tempfile
    zip_file.write(file_path, encoded_path, zipfile.ZIP_DEFLATED)
  File "/usr/lib64/python2.7/zipfile.py", line 1137, in write
    self._writecheck(zinfo)
  File "/usr/lib64/python2.7/zipfile.py", line 1102, in _writecheck
    raise LargeZipFile("Filesize would require ZIP64 extensions")
LargeZipFile: Filesize would require ZIP64 extensions
fatal: [amsbldw32i01.uniface.m4.local]: FAILED! => {
    "changed": true,
    "dest": "C:\\Temp\\BuildMachineTemp\\",
    "failed": true,
    "msg": "failed to create tmp zip file: Filesize would require ZIP64 extensions",
    "operation": "folder_copy",
    "src": "/cwnl/common/software/microsoft/VisualStudio_2015"
}
@ansibot
Copy link
Contributor

ansibot commented Nov 8, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community labels Nov 8, 2017
u625030 added a commit to u625030/ansible that referenced this issue Nov 8, 2017
enable large zip file support in win_copy
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Nov 8, 2017
@jborean93
Copy link
Contributor

jborean93 commented Nov 9, 2017

I swore I tested this but will try again and see what happens. A zip is only used when there are multiple files that need to be changed, if it is just the single file it will be copied across as is.

Edit: I've added some more comments to your PR, I see where I went wrong with my original testing. While it not perfect, while people wait for a release, instead of copying a directory, if you copy a single file a zip file is not used at all and so shouldn't have this issue.

jborean93 pushed a commit that referenced this issue Nov 9, 2017
* Update win_copy for #32677

enable large zip file support in win_copy

* Update win_copy.py

(cherry picked from commit 6d597ac)
mikewiebe pushed a commit to mikewiebe-ansible/ansible that referenced this issue Nov 9, 2017
* Update win_copy for ansible#32677

enable large zip file support in win_copy

* Update win_copy.py
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants