3

I searched in several forums and everyone suggested to add below line in the yaml.

- task: PublishBuildArtifacts@1

In my case, i am using the classic editor as it is my first time learning Devops. The publish artifact task was already added but I still see the error, "Container path not found". Can someone let me know what am i missing here?

My release pipeline is looking for "D:\a\r1\a.." path whereas artifacts were copied to "D:\a\1\a.." in the build pipeline.

G_S
  • 85
  • 1
  • 11
  • Please check if your working directory is correct in your tasks. If you still have issues, please share your configuration of your build and release pipeline and release logs. – Walter Jan 08 '21 at 02:48

3 Answers3

1

My release pipeline is looking for "D:\a\r1\a.." path whereas artifacts were copied to "D:\a\1\a.." in the build pipeline.

The release pipeline will download your build artifact to the folder "D:\a\r1\a". You can find this in your release logs: enter image description here I can reproduce your issue if the Working Directory of the command line task is incorrect. Please make sure the Working Directory of your task is exist.

enter image description here

Update: For example: I want to run test.exe in my folder: enter image description here

The working directory should be $(System.DefaultWorkingDirectory)/_Jan-CI/drop/test here. enter image description here

Walter
  • 2,640
  • 1
  • 5
  • 11
  • If I provide this as my working directory, my exe which is in the drop folder is not getting executed. That is the reason i browsed and selected below and the Release pipeline fails with error : Container path not found: 'D:\a\r1\a\_MyFirstPipeline\drop\bin\Release\TestDevOps.exe' ` $(System.DefaultWorkingDirectory)/_MyFirstPipeline/drop/bin/Release/TestDevOps.exe`` – G_S Jan 08 '21 at 14:10
  • Please try to use $(System.DefaultWorkingDirectory)/_MyFirstPipeline/drop/bin/Release as your working directory. I have added a sample in my answer. You can refer to it. – Walter Jan 11 '21 at 09:21
  • @NethiSwapna Not get your response for several days, would you please share your latest information about this issue? – Walter Jan 21 '21 at 03:23
0

Sorry can't comment on Walter's answer atm but just want to add to Walter's answer. Based on the error

Container path not found: 'D:\a\r1\a_MyFirstPipeline\drop\bin\Release\TestDevOps.exe' ` $(System.DefaultWorkingDirectory)/_MyFirstPipeline/drop/bin/Release/TestDevOps.exe``

It seems like you might have a typo. There is an extra 'a' before '_MyFirstPipeline' in your path compared to the 2nd one

Also, as per Walters comments, if you provide your code then it'll help people diagnose and help more.

I'm going to assume that if your pipeline is looking for your artifact in a different place than where your artifact is stored then thats the error and the cause could be a typo. Check your code that is publishing the artifact and what location it is using and the code where you're trying to fetch it from matches.

0

I had a similar issue and noticed that my release pipeline has the option enabled "Skip download of artefacts" so in my case release working directory is empty (r1 or r2)

Please note during release, the file will be copied from "_Work<somenumber>\a" to "_work\r\drop..."

Example: "_Work\2\a" to "_work\r2\drop..."

Eric Aya
  • 69,473
  • 35
  • 181
  • 253