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 fails when copy an empty subfolder #50077

Closed
cesarfn4 opened this issue Dec 18, 2018 · 2 comments · Fixed by #50126
Closed

win_copy fails when copy an empty subfolder #50077

cesarfn4 opened this issue Dec 18, 2018 · 2 comments · Fixed by #50126
Assignees
Labels
affects_2.8 This issue/PR affects Ansible v2.8 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

@cesarfn4
Copy link

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_copy

ANSIBLE VERSION
ansible-playbook 2.8.0.dev0 (devel 4d0f2e632c) last updated 2018/12/17 14:57:44 (GMT +000)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /var/lib/awx/ansible/lib/ansible
  executable location = /var/lib/awx/ansible/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
STEPS TO REPRODUCE

Create a folder with empty sub-folders and try to copy them to another sub-folder.

  • Source: C:\Data\Test
Data
└── Test
    ├── test1  --> empty
    ├── test2  --> empty
    └── test3  --> empty

  • Target: C:\Data_Backup\Test\..
Data_Backup
└── Test --> empty

Playbook:

---
- name: Testing windows copy module
  hosts: windows

  tasks:
  - set_fact:
      source: "C:\\Data\\Test"
      target: "C:\\Data_Backup\\Test\\.."
 
  - name: "copy"
    win_copy:
      src: "{{ source }}"
      dest: "{{ target }}"
      remote_src: True
EXPECTED RESULTS

It should work fine but without displaying any error.

ACTUAL RESULTS

It is working as expected, but it is displaying the following error.

The full traceback is:
The property "length" cannot be found in the input for any objects.
At line:136 char:39
+             $size = ($dir_files_sum | Measure-Object -property length -sum).Sum
+                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Measure-Object], PSArgumentException
    + FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft.PowerShell.Commands.MeasureObjectCommand

ScriptStackTrace:
at Get-FileSize, <No file>: line 136
at <ScriptBlock>, <No file>: line 355

fatal: [windows-1.redhat.local]: FAILED! => {
    "changed": false, 
    "dest": "C:\\Data_Backup\\Test\\..", 
    "msg": "Unhandled exception while executing module: Cannot process argument because the value of argument \"Property\" is not valid. Change the value of the \"Property\" argument and run the operation again.", 
    "src": "C:\\Data\\Test"
}

Attached full output:
debug_output.txt

@ansibot
Copy link
Contributor

ansibot commented Dec 18, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Dec 18, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. 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 Dec 18, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Dec 18, 2018
@jborean93 jborean93 self-assigned this Dec 18, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 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