Artifact dependency not working on remote build agent
I have a build that uses an artifact dependency to pull the last successful build from another project before it runs. When I run it on the main build agent, it works fine.
However, when I run the same build on a remote agent, it fails with "Failed to resolve artifact dependency". The details in the build log are:
Failed to download file 'Example.Shared.Common.csproj': Failed to download [https://teamcity.example.io/httpAuth/repository/download/example_C_exampleSharedDataAccess/6540.tcbuildid/example.Shared.Common.csproj]: java.io.IOException: Illegal status [404] while downloading https://teamcity.example.io/httpAuth/repository/download/Example_C_ExampleSharedDataAccess/6540.tcbuildid/Example.Shared.Common.csproj: Not Found (jetbrains.buildServer.artifacts.impl.SourcePathAwareResolvingFailedException)
I suspect it is related to authentication but I am not sure how the remote agent is supposed to access the main server. The artifact does exist and if I run the URL above in my desktop browser (up to repository/download/Example_C_ExampleSharedDataAccess) then it lists all of the artifact folders but if I click into 6540.tcbuildid, I get a 404. If I try the same thing on my remote agent in the browser, it asks me for userid and password, which I don't know since the agent was setup automatically by the server.
The instructions don't seem to tell me to setup anything else.
By the way, other builds work fine on the remote agent, it is just the build with the artifact dependency.
Please sign in to leave a comment.
Hi Luke,
do you have a proxy server in front of teamcity? This is one of the most common scenarios where this fails. Firewalls might also be preventing this but it would normally not get a 404 message, just a connection timeout or a rejection on the connection. If the local agent works, then it's very likely that the issue is that something in the network traffic is modifying the request, as otherwise it doesn't make all that much sense. The requests are usually logged in some of the server logs, which you might want to probe in case they contain any information.
About your browser, the authentication request should require username and password of your regular user. Agents use their own authorization protocol so there is no way to test agent connectivity via the browser.
If the browser (after auth) fails to hit the same file (including the full path), then it seems clear that routing is off.
Please check those options and feel free to report back with the results.
Sorry for the delay, we simply moved all the builds back to the main agent but now we need to move them to the external agent again. We are using IIS in front of the site but don't generally have any problems with that, it is only with the artifact dependency that we have the error.
If I authenticate in the browser, I can navigate to https://teamcity.company.io/httpAuth/repository/download/Company_C_SharedCommon and I can see the list of all the links to the build artifacts so that part of the link is correct but I cannot click into any of the links I get a 404. If I do the same on the local agent, I get "unable to connect". Obviously, these might not work as GET requests so that part is fine but I am confused as to what else I can try.
The build log error is this:
Failed to download [https://teamcity.company.io/httpAuth/repository/download/Company_C_SharedCommon/8723.tcbuildid/Company.Shared.Common.csproj]: java.io.IOException: Illegal status [404] while downloading https://teamcity.company.io/httpAuth/repository/download/Company_C_SharedCommon/8723.tcbuildid/Company.Shared.Common.csproj: Not Found (jetbrains.buildServer.artifacts.impl.SourcePathAwareResolvingFailedException)
Hi Luke,
if you are getting 404 errors while trying to access via that URL, there is something wrong. The server should return a 403 via the browser as this is url is meant for other tasks, but the server responding with a 404 on a link that it generates is very rare.
It still seems to me like there is something on the proxy (or network infrastructure separating internal from external agents), as this URLs are obviously generated automatically (and I assume that the artifacts exist). Particularly the fact that those builds work from internal agents should point at something wrong in the routing of the requests that happens differently for both agents.
We have a list of some common misconfigurations on proxies that might have an impact here: https://www.jetbrains.com/help/teamcity/how-to.html#HowTo...-Commonmisconfigurations