1
votes

I have a build set up in VSTS and at the end I want to Publish my Artifacts to VSTS for releasemanagement and I want to Publish my Artifacts to a file share for other purposes. So I have 2 Publish Artifacts tasks.

Build task

To VSTS To VSTS

To FileShare

To FileShare I get this error

Build error

It doesn't matter in which order I put the tasks. When I put file share first then to VSTS will fail and when I put VSTS first the publish to file share fails.

When I do a commit and a build is started automatically it sometimes works. When I manually start a second build I get the error.

Here is the complete build log: Build log

1
Just a wild guess, but it's possible that the Publish Artifact task is staging the artifact using the same file name in your build.artifactsstagingdirectory. A few options...change the staging directory for one task or try to remove the file before the second task runs. - Dan Wilson
The publish artifact doesn't copy files to build.artifactsstagingdirectory I think it only reads what is present and copies it to VSTS or my file share. - Danny
@Danny can you share the whole log for the Publish Build Artifacts task which publish files to share path? Besides, for the build 106023, did you also push artifacts with the name 0.1.0-unstable.18? And did you use the same build agent for build 106023 and the build failed now? - Marina Liu
I added a link to the complete build log to my question - Danny

1 Answers

3
votes

It's telling you the error: Artifact 0.1.0-unstable.18 already exists.

You can't publish two artifacts with the same name. You will have to uniquely identify each artifact.