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

"Machine Names required", but should not be required, and machine names being prepended to destination folder #15646

Closed
lrpinto opened this issue Dec 29, 2021 · 0 comments · Fixed by #15870

Comments

@lrpinto
Copy link

lrpinto commented Dec 29, 2021

Bug

Type: Error: "Machine Names required", but should not be required, and machine names being prepended to destination folder

Enter Task Name: WindowsMachineFileCopy Version 2

https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/WindowsMachineFileCopyV2/WindowsMachineFileCopy.ps1

Environment

  • Server - Azure Dev Ops Release Pipeline

FootAsylumDevOps
Epos
releaseId=79

  • Agent - Private:

OS: Windows 10
Agent Version: 2.195.2

Issue Description

Task : Windows machine file copy
Description : Copy files to remote Windows machines
Version : 2.1.13

The YAML snippet here specifies that "machineNames", "adminUserName" and "adminPassword" are parameters for the "sourcePath:" section, and that these parameters are all "optional".

However, in the code here we can see that all those parameters are required. And indeed if we don't set them on the task, we will get the error "[error]Required: 'MachineNames' input" as it can be seen in the logs of "Attempt #7". There should be no reason to forcing these parameters to be required.

Furthermore, the task is using machine names to build the target path, which is also incorrect. Note that as per the YAML the machine names is a parameter for the "sourcePath" section, but the task uses it to prepend to the "targetPath". This results in the task trying to copy the file to as many destinations as the machine names specified in source path. See logs in "Attempt #8"

Expected outcome:

  • "machineNames", "adminUserName" and "adminPassword" should not be required parameters
  • "machineNames" is a parameter for the "sourcePath" section, and not be used for the "targetPath" section
  • "machineNames" should not be used to specify the destination path of the file being copied

Reproduce:

Scenario 1 -> "Attempt #7"

Deployment group job with two targets
Screenshot 2021-12-29 at 13 21 35

Configuration of the Task with no machine names
Screenshot 2021-12-29 at 13 20 21

Expect this to run and copy the file from source to target.

YAML for the task:
steps:

  • task: WindowsMachineFileCopy@2
    displayName: 'Copy files from $(System.DefaultWorkingDirectory)/_epos-software-release-candidate-branch/drop/target/epos.war'
    inputs:
    SourcePath: '$(System.DefaultWorkingDirectory)/_epos-software-release-candidate-branch/drop/target/epos.war'
    TargetPath: 'C:\ProgramData\Tomcat9\webapps'

Scenario 2 -> "Attempt #8"

Deployment group job with two targets
Screenshot 2021-12-29 at 13 21 35

Configuration of the Task with one machine name (just to show that this machine name will be used as target destination)
Screenshot 2021-12-29 at 13 30 03

Task logs

1_Stage 1- Copy EPOS WAR FILE-2.zip

Troubleshooting

Could not find anything related to this issue.

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Error logs

Scenario 1 Errors:

2021-12-29T12:24:26.8619797Z ##[error]Required: 'MachineNames' input

Scenario 2 Errors:

Fails on one deployment agent because machine name it is used to set the target path on this agent, and in that agent the target path does not exist, should not be prepending machine name to target path

Screenshot 2021-12-29 at 13 32 32

@v-saikumart v-saikumart added the environment:need-to-triage Issues need to be triage by environment-deployment team label Dec 30, 2021
@v-ibshaik v-ibshaik self-assigned this Jan 3, 2022
@v-ibshaik v-ibshaik added environment:under-investigation and removed Area: Release triage environment:need-to-triage Issues need to be triage by environment-deployment team labels Jan 3, 2022
@v-ibshaik v-ibshaik assigned nadesu and v-ibshaik and unassigned nadesu and v-ibshaik Jan 5, 2022
@v-ibshaik v-ibshaik assigned v-ibshaik and v-nagarajku and unassigned v-ibshaik Jan 31, 2022
v-nagarajku added a commit that referenced this issue Mar 2, 2022
…ine names being prepended to destination folder #15646 (#15870)

* Making Machines,AdminLogin,Password as Mandatory

* Making Machines,Admin Login and Password required fields
aasim pushed a commit that referenced this issue Mar 8, 2022
…ine names being prepended to destination folder #15646 (#15870)

* Making Machines,AdminLogin,Password as Mandatory

* Making Machines,Admin Login and Password required fields
aasim added a commit that referenced this issue Mar 8, 2022
* Fixed casing for packaging api data

* Updated task version

* [Maven tasks] Bump the codecoverage-tools package at the dependencies (#15928)

* Update cc-tools package for MavenV2 task

* Update cc-tools package for MaveV3 task

* Disabled percent encoding (#15931)

* Update npmauth to handle retries cleanly (#15914)

* Update npmauth.ts

* Update task.json

* Update task.loc.json

* Update npmauth.ts

* RED

Co-authored-by: Your Name <[email protected]>

* Updated Helm download Url (#15821)

* updated helm download url

* bumped task vesrions required for this change

* bumped task versions

* [FtpUploadV2] Resolve dependabot alert about shelljs (#15881)

* fix dependencies

* fix build

build error are caused by tasklib 3.x return types change from "<type>" to "<type> | undefined"
functionally, these method calls should be identical

* bump task version

* Add simple unit tests to check getting input parameters and start of task

* Delete debug

* Fix EOL

* Updated task version to 201

* Added test for successful execution

Co-authored-by: Tatyana Kostromskaya (Akvelon) <[email protected]>
Co-authored-by: Tatyana Kostromskaya <[email protected]>
Co-authored-by: Denis Tikhomirov <[email protected]>
Co-authored-by: Denis Tikhomirov <[email protected]>
Co-authored-by: Anatoly Bolshakov <[email protected]>

* Fix README.md section on installing Invoke-SqlCommand on an agent (#15693)

* Add another way of installing Invoke-SqlCommand.
* Fix dead link.

Co-authored-by: Kim Jämiä <[email protected]>
Co-authored-by: Philipson Joseph V <[email protected]>

* updating  the azure-pipelines-tasks-azure-arm-rest-v2 to 2.198.2  (#15935)

* version update of common module

* version update

Co-authored-by: rajnish-byte <[email protected]>

* Fix shelljs vulnerability for tasks (#15972)

* bump shelljs for ArchiveFilesV2

* bump shelljs for BashV3

* bump shelljs for CMakeV1

* bump shelljs for CocoaPodsV0

* bump affected tasks versions

* 15646 - Machine Names required", but should not be required, and machine names being prepended to destination folder #15646 (#15870)

* Making Machines,AdminLogin,Password as Mandatory

* Making Machines,Admin Login and Password required fields

* fix no wait result bug (#15957)

* fix no wait result bug

* bump version

Co-authored-by: Anatoly Bolshakov <[email protected]>
Co-authored-by: Nikita Ezzhev <[email protected]>

* [UsePythonV0] Download python from registry (#15820)

* download python from registry if absent in cache

* add unit test

* fixes & debug messages

* fix manifest branch name

* fix debug message for python archive file name

* remove unneeded function

* fix unit tests failing on unix

* only check os version once

* add unit test for ubuntu version lookup

* adjust error messages

* add input to allow unstable versions

* fix ubuntu test

* add test for unstable version download

* add comments

* adjust comments

* select arch based on input

* extract interfaces into separate file

* make allowUnstable optional

* add a separate debug message for downloading

* explain what the registry is more clearly

* bump task version due to a new sprint

* fix allowUnstable default value

* format osutil to unify code style

* Updated version

Co-authored-by: Aasim Malladi <[email protected]>
Co-authored-by: Konstantin Tyukalov <[email protected]>
Co-authored-by: Anatoly Bolshakov <[email protected]>
Co-authored-by: Marcin Strzyz <[email protected]>
Co-authored-by: Your Name <[email protected]>
Co-authored-by: rajnish-byte <[email protected]>
Co-authored-by: Daniil Shmelev <[email protected]>
Co-authored-by: Tatyana Kostromskaya (Akvelon) <[email protected]>
Co-authored-by: Tatyana Kostromskaya <[email protected]>
Co-authored-by: Denis Tikhomirov <[email protected]>
Co-authored-by: Denis Tikhomirov <[email protected]>
Co-authored-by: Kim Jämiä <[email protected]>
Co-authored-by: Kim Jämiä <[email protected]>
Co-authored-by: Philipson Joseph V <[email protected]>
Co-authored-by: v-hinti <[email protected]>
Co-authored-by: v-nagarajku <[email protected]>
Co-authored-by: Ruoyu Wang <[email protected]>
Co-authored-by: Nikita Ezzhev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment