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 doesnt work when folder name has special character #609

Open
periyasamy003 opened this issue May 10, 2024 · 2 comments
Open

win_copy doesnt work when folder name has special character #609

periyasamy003 opened this issue May 10, 2024 · 2 comments

Comments

@periyasamy003
Copy link

SUMMARY

Tasks are failing when the folder name has special characters.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_copy

ANSIBLE VERSION
ansible-2.9.9
COLLECTION VERSION

CONFIGURATION

OS / ENVIRONMENT

Client--> Linux (Jenkins worker node)
Target --> Windows server

STEPS TO REPRODUCE
  • name: Copy files from workspace with special characters
    win_copy:
    src: '{{ WORKSPACE }}/[...slug]/' # Using escape character
    dest: 'C:\tmp'
    exclude: ['.git']
    force: no
EXPECTED RESULTS
ACTUAL RESULTS
TASK [Copy files from workspace with special characters] **************************
fatal: [win_server]: FAILED! => {"changed": true, "dest": "C:\\tmp", "module_stderr": "An error occurred while creating the pipeline.\r\n    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId : RuntimeException\r\n \r\nException calling \"Run\" with \"1\" argument(s): \"Exception calling \"Invoke\" with \"0\" argument(s): \"The running command st\r\nopped because the preference variable \"ErrorActionPreference\" or common parameter is set to Stop: An item with the spec\r\nified name C:\\tmp\\[...slug] already exists.\"\"\r\nAt line:93 char:5\r\n+     $output = $entrypoint.Run($payload)\r\n+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n    + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n", "module_stdout": "", "msg": "MODULE FAILURE", "operation": "folder_copy", "rc": 1, "src": "/opt/jenkins/workspace/"}
@jborean93
Copy link
Collaborator

Can you try a newer version of Ansible and subsequently a newer version of this collection. 2.9 is quite old and the win_copy for that code predated this collection. I also believe I fixed this issue at some point but I’m not 100% sure on that.

@hiyokotaisa
Copy link
Contributor

I tested same scenario with ansible-core 2.15.10 but it is working as expected. I'm assuming this is fixed on current ansible version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants