1

I have two Devops Azure release stages(DEV and TT). Dev is able to retrieve artifacts from build source CI pipeline and copy to C drive(looks ok) where as, TT copies to D drive and I am unable to locate the path on build server like D:\a\r1\a.... and throws an exception as follows.

[error]Exception calling "GetHostByName" with "1" argument(s): "No such host is known"

How do I set the default copy drive to C for TT?

enter image description here

Community
  • 1
  • 1
ANIL MANE
  • 1,395
  • 2
  • 16
  • 30
  • Do you use self-hosted agent or Microsoft hosted agent? can you share the stages steps? – Shayki Abramczyk Nov 19 '19 at 07:06
  • I'm using Microsoft agent and I do have copy task to copy from D drive to C which throws an error as described above. Surprisingly I am not able see any folders in D drive after agent pulls the artifacts to D:\a\r1\.... – ANIL MANE Nov 19 '19 at 15:47
  • I got the solution, I was using different release agents for Dev and TT. Changing both agent to single worked out. – ANIL MANE Nov 19 '19 at 17:06

1 Answers1

1

Update

If you couldn't see any folders getting created on build agent. Then one possibility, that two stages may not run in same build agent. Please double check this info.

If you still get similar error, kindly set debug=true and share related logs here for troubleshooting.

OP verified issue solved: Using different release agents for Dev and TT. Changing both agent to single worked out.


According to your error info, guess you are using host agent.

It's not related to which drive you are using.

Avoid hard-coded references

When you use a Microsoft-hosted agent, always use variables to refer to the build environment and agent resources. For example, don't hard-code the drive letter or folder that contains the repository. The precise layout of the hosted agents is subject to change without warning.

Source Link


If you are using self-host agent. It's related to your default agent installed path. There is a related predefined variables

Agent.ReleaseDirectory

The directory to which artifacts are downloaded during deployment of a release. The directory is cleared before every deployment if it requires artifacts to be downloaded to the agent. Same as System.ArtifactsDirectory and System.DefaultWorkingDirectory.

More details please refer to Agent variables

If you want to change the path, you need to make sure you agent is installed under C:\ not D:\. Besides, you could also choose to use Copy Files task in release pipeline to copy files from a source folder to a target folder according to your needs.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • I do have copy task to copy files from D to C but I don't see any folders getting created in build server and it fails. – ANIL MANE Nov 19 '19 at 15:50
  • @ANILMANE If you couldn't see any folders getting created. Then one possibility, that two stages may not run in same build agent. Please double check this info. If you still get same error, kindly set `debug=true` and share related logs here for troubleshooting. Have updated my reply. – PatrickLu-MSFT Nov 20 '19 at 02:47
  • @ANILMANE Sorry for missing your latest comment under the question. According to it, seems your issue got solved after make sure stage running on a single agent. **Copy File Task** could not copy files across build agent/machine. Since your issue solved. If my reply helped or gave a right direction. Appreciate for [marking it as an answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) which will also help others in the community. In case they get stuck in same situation. – PatrickLu-MSFT Nov 20 '19 at 02:57