I have an application that encapsulates interaction with the TFS REST API in order to queue a build. The application simply sends the required json to the API and it worked for months until it suddenly started returning 409 - conflict.
System.Net.WebException: The remote server returned an error: (409) Conflict. (https://tfs2015/tfs/spf/SPF/_apis/build/builds?api-version=2.0:{"definition":{"id":190},"parameters":"{}"})
w3.org define the http code 409 as:
The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required.
The 409 won't go away either - a simple retry consistently fails. Even the whole "have you tried switching it off an on again" approach of restarting the build servers hasn't helped.