2016-12-28 3 views
0

빌드를 대기열에 넣기 위해 TFS REST API와의 상호 작용을 캡슐화하는 애플리케이션이 있습니다. 응용 프로그램은 필요한 json을 API로 보내고 갑자기 409 충돌을 반환하기 전까지 몇 달 동안 작동합니다. 간단한 재 시도가 지속적으로 실패 -409 TFS를 사용하는 충돌 응답 2015 대기열 작성을위한 REST API

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.

409은 사라지지 않을 것입니다 중 하나 :

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는 같은 HTTP 코드 (409)를 정의합니다. 심지어 빌드 서버를 다시 시작하는 전체 "당신이 그것을 다시 켰다가 다시 시도해 보았습니다"라는 접근 방법은 도움이되지 못했습니다.

답변

0

"충돌"은 사실 이상한 동시성 문제가 아니라 빌드 요구를 충족시킬 수없는 상태입니다.

기본적으로 대기중인 빌드 정의에는 "PowerShell = 4"가 필요합니다. 빌드는 서버를 PowerShell 5로 업데이트 한 직후에 409를 제공하기 시작했습니다.

이 경우 409는 빌드 요구 사항을 풀의 빌드 에이전트가 충족시킬 수 없음을 의미합니다.

특정 버전의 PowerShell 대신 PowerShell을 요구하도록 빌드 정의를 변경하면 문제가 해결되었습니다.

(내 앱이 전체 응답을 콘솔에 버리면 곧 처리 할 수 ​​있으므로 가까운 장래에 업데이트 할 예정입니다.)