404 trying to resolve artifact dependency
I'm trying to pass a `.txt` file between builds of the same configuration to improve test logging, but my build is failing with a 404 error:
```
Resolving artifact dependencies
Downloading files from <Project / Configuration, latest successful build> for pattern [+:Tests/# TeamCity Artifacts/artifact.txt]
Failed to resolve artifact dependency <Project / Configuration, latest successful build>:
Failed to get source paths list:
Failed to download [https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/latest.lastSuccessful/teamcity-ivy.xml]:
java.io.IOException:
Illegal status [404] while downloading https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/latest.lastSuccessful/teamcity-ivy.xml:
(jetbrains.buildServer.artifacts.ResolvingFailedException)
```
If I navigate to https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/ I can see lots of previous builds but no `latest.lastSuccessful`.
Please sign in to leave a comment.
I can successfully navigate to the source paths list for a specific build, e.g. https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/12345/teamcity-ivy.xml or https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/12345678.tcbuildid/teamcity-ivy.xml, and they have a list of artifacts as expected.
Making the dependency optional (`?:` instead of `+:`) allows the build to continue, but it still gives an error:
```
Details: cannot get any artifacts from the source build: Failed to get source paths list: Failed to download [https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/latest.lastSuccessful/teamcity-ivy.xml]
```
Solved - the issue was the build branch filter. From the Artifact Dependencies documentation:
The default branch does not have any builds, so it would fail. In my case I wanted to use the last finished build on any branch, so per the Branch Filter documentation I set it to
+:*to include all branches. This can be checked using the URL https://teamcity.company.com/httpAuth/repository/download/Project_Configuration/.lastFinished/teamcity-ivy.xml?branch=%2B%3A*