Closed userjeff3 closed 5 years ago
Hi @userjeff3
The reason why the Authentication needs to be specified is because we are accessing the VSTS/TFS REST API which requires authentication. Also you might want to access a different server than the one that triggered your build, so you need to be able to specify what authentication method you want.
Regarding your issue, can you please try to use OAuth Authentication and make sure that both the username and the password/token field are completly empty and try again?
Thanks for the explanation. My setup is as simple as it gets, one project on one server.
The first thing I tried was oauth with no user or password. It sounds like I need to debug the system.accesstoken.
I deleted the task, added it back anew (in order to reset everything to defaults), specified the build definition and changed to oauth token. Here's the results of that latest attempt:
2018-03-22T16:42:47.2949999Z ##[debug]Evaluating condition for step: 'Trigger a new build of taskname' 2018-03-22T16:42:47.2949999Z ##[debug]Evaluating: succeeded() 2018-03-22T16:42:47.2949999Z ##[debug]Evaluating succeeded: 2018-03-22T16:42:47.2949999Z ##[debug]=> (Boolean) True 2018-03-22T16:42:47.2949999Z ##[debug]Expanded: True 2018-03-22T16:42:47.2949999Z ##[debug]Result: True 2018-03-22T16:42:47.2949999Z ##[section]Starting: Trigger a new build of taskname 2018-03-22T16:42:47.2949999Z ============================================================================== 2018-03-22T16:42:47.2949999Z Task : Trigger Build 2018-03-22T16:42:47.2949999Z Description : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not. 2018-03-22T16:42:47.2949999Z Version : 2.7.1 2018-03-22T16:42:47.2949999Z Author : Benjamin Huser 2018-03-22T16:42:47.2949999Z Help : 2018-03-22T16:42:47.2949999Z ============================================================================== 2018-03-22T16:42:48.7945505Z ##[debug]agent.TempDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work_temp 2018-03-22T16:42:48.7945505Z ##[debug]loading inputs and endpoints 2018-03-22T16:42:48.7945505Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2018-03-22T16:42:48.8101754Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2018-03-22T16:42:48.8258000Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_BLOCKINPROGRESSBUILDS 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_BUILDDEFINITION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_DROPDIRECTORY 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_USESAMEBRANCH 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_USESAMESOURCEVERSION 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH 2018-03-22T16:42:48.8258000Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME 2018-03-22T16:42:48.8258000Z ##[debug]loading SECRET_WINRMPWD 2018-03-22T16:42:48.8258000Z ##[debug]loaded 22 2018-03-22T16:42:48.8258000Z ##[debug]Agent.ProxyUrl=undefined 2018-03-22T16:42:48.8258000Z ##[debug]Agent.CAInfo=undefined 2018-03-22T16:42:48.8258000Z ##[debug]Agent.ClientCert=undefined 2018-03-22T16:42:48.8258000Z ##[debug]Agent.SkipCertValidation=undefined 2018-03-22T16:42:48.8258000Z ##[debug]definitionIsInCurrentTeamProject=true 2018-03-22T16:42:48.8258000Z ##[debug]tfsServer=null 2018-03-22T16:42:48.8570568Z ##[debug]buildDefinition=taskname 2018-03-22T16:42:48.8570568Z ##[debug]ignoreSslCertificateErrors=false 2018-03-22T16:42:48.8570568Z ##[debug]queueBuildForUserThatTriggeredBuild=true 2018-03-22T16:42:48.8570568Z ##[debug]useSameSourceVersion=false 2018-03-22T16:42:48.8570568Z ##[debug]useSameBranch=true 2018-03-22T16:42:48.8570568Z ##[debug]branchToUse=null 2018-03-22T16:42:48.8570568Z ##[debug]waitForQueuedBuildsToFinish=false 2018-03-22T16:42:48.8570568Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=60 2018-03-22T16:42:48.8570568Z ##[debug]failTaskIfBuildsNotSuccessful=true 2018-03-22T16:42:48.8570568Z ##[debug]downloadBuildArtifacts=false 2018-03-22T16:42:48.8570568Z ##[debug]dropDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work 2018-03-22T16:42:48.8570568Z ##[debug]storeInEnvironmentVariable=false 2018-03-22T16:42:48.8570568Z ##[debug]demands=null 2018-03-22T16:42:48.8570568Z ##[debug]queueid=null 2018-03-22T16:42:48.8570568Z ##[debug]buildParameters=null 2018-03-22T16:42:48.8570568Z ##[debug]authenticationMethod=OAuth Token 2018-03-22T16:42:48.8570568Z ##[debug]username=null 2018-03-22T16:42:48.8570568Z ##[debug]****=null 2018-03-22T16:42:48.8570568Z ##[debug]enableBuildInQueueCondition=false 2018-03-22T16:42:48.8570568Z ##[debug]includeCurrentBuildDefinition=true 2018-03-22T16:42:48.8570568Z ##[debug]blockingBuildsList=null 2018-03-22T16:42:48.8570568Z ##[debug]blockInProgressBuilds=false 2018-03-22T16:42:48.8570568Z ##[debug]dependentOnSuccessfulBuildCondition=false 2018-03-22T16:42:48.8570568Z ##[debug]dependentBuildsList=null 2018-03-22T16:42:48.8570568Z ##[debug]dependentOnFailedBuildCondition=false 2018-03-22T16:42:48.8570568Z ##[debug]dependentFailingBuildsList=null 2018-03-22T16:42:48.8570568Z Using current Team Project Url 2018-03-22T16:42:48.8570568Z Path to Server: http://buildbox:8080/tfs/EPC%20dev/ASR-TRS 2018-03-22T16:42:48.8570568Z Trying to fetch authentication token from system... 2018-03-22T16:42:48.8570568Z Using OAuth Access Token 2018-03-22T16:42:48.8570568Z Build shall be triggered for same user that triggered current build: Jeff 2018-03-22T16:42:48.8570568Z Using same branch as source version: $/ASR-TRS 2018-03-22T16:42:48.8726784Z Authentication failed - please make sure your settings are correct. 2018-03-22T16:42:48.8726784Z If you use the OAuth Token, make sure you enabled the access to it on the Build Definition. 2018-03-22T16:42:48.8883041Z If you use a Personal Access Token, make sure it did not expire. 2018-03-22T16:42:48.8883041Z If you use Basic Authentication, make sure alternate credentials are enabled on your TFS/VSTS. 2018-03-22T16:42:48.8883041Z ##[debug]task result: Failed 2018-03-22T16:42:48.8883041Z ##[error]Authentication with TFS Server failed. Please check your settings. 2018-03-22T16:42:48.8883041Z ##[debug]Processed: ##vso[task.issue type=error;]Authentication with TFS Server failed. Please check your settings. 2018-03-22T16:42:48.8883041Z ##[debug]Processed: ##vso[task.complete result=Failed;]Authentication with TFS Server failed. Please check your settings. 2018-03-22T16:42:48.8883041Z ##[section]Finishing: Trigger a new build of taskname
Thanks!
Hmm that is strange, i can't see anything special about your setup. One thing that comes to my mind as you are using TFS that you can try is to set the Ignore SSL Certificate Errors option under Basic Configuration.
Why I was wondering about the empty password is basically the part of your log after the username:
2018-03-22T16:42:48.8570568Z ##[debug]username=null 2018-03-22T16:42:48.8570568Z ##[debug]********=null 2018-03-22T16:42:48.8570568Z
Normally that should be the password field, however it looks strangely formatted. That's why I thought there might be some variable or something in that is causing some issues when authenticating...
I set the ignore option, same result. I echoed some variables: SYSTEM_ACCESSTOKEN = **** SYSTEM_ENABLEACCESSTOKEN = true How else can I test the system access token?
Hi
to be honest I'm a bit puzzled by this, as there is usually no problem with the OAuth token.
What you could try is to use a Personal Access Token and see if that works to narrow down the issue...if it works it means something with the OAuth is wrong, if not it might be a more general issue.
Sorry for the inconvenience though.
What about basic authentication? Nope, same result:
2018-03-23T20:03:35.4300814Z Using Basic Authentication 2018-03-23T20:03:35.4300814Z Build shall be triggered for same user that triggered current build: Jeff Yoder 2018-03-23T20:03:35.4300814Z Using same branch as source version: $/ASR-TRS 2018-03-23T20:03:35.4925808Z Authentication failed - please make sure your settings are correct. 2018-03-23T20:03:35.4925808Z If you use the OAuth Token, make sure you enabled the access to it on the Build Definition. 2018-03-23T20:03:35.4925808Z If you use a Personal Access Token, make sure it did not expire. 2018-03-23T20:03:35.4925808Z If you use Basic Authentication, make sure alternate credentials are enabled on your TFS/VSTS. 2018-03-23T20:03:35.4925808Z ##[debug]task result: Failed 2018-03-23T20:03:35.4925808Z ##[error]Authentication with TFS Server failed. Please check your settings. 2018-03-23T20:03:35.4925808Z ##[debug]Processed: ##vso[task.issue type=error;]Authentication with TFS Server failed. Please check your settings. 2018-03-23T20:03:35.4925808Z ##[debug]Processed: ##vso[task.complete result=Failed;]Authentication with TFS Server failed. Please check your settings.
I'll try PAT next.
Yeah for Basic you actually need to enable it specifically so I went for the PAT version as it is, as far as I know, less effort to configure.
If PAT fails as well I'm trying to upload a new version tomorrow that at least should include more logging information so we can actually figure out what is happening and it's really the authentication that causes problems and not something else.
Same result with a PAT. Thanks for a new debug version! But I'll be on vacation next week so I'll have to wait until I can try it.
Ok, so my feeling than is that something else seems not to work as it should...
I will let you know here once I uploaded a new version with increased logging.
Hi @userjeff3
I hope you can/could enjoy your vacation. I uploaded in the meanwhile a new version which has some improved logging when you start your build with the system.debug variable set to true.
Could you please try this out once you are back and send me the log files produced by the task. This should give at least a hint on what is going wrong.
Hi @ushastyy
I see in the log that you use Personal Access Token, but there is nothing set in the "Password" field. Did you mean to use the OAuth authentication (then the password field has to be left empty), if using a PAT you actually need to specify the token that shall be used.
@huserben, yes, you are right, I have copied the log from wrong path. But the situation with OAuth was the same. And I found out why. I had to enable "Allow Scripts to Access OAuth Token". Maybe it is answer for userjeff3 to.
Edit: Moved your additional question to separate issue to keep this discussion on topic, see: https://github.com/huserben/TfsExtensions/issues/62
Thanks for the new version! Strangely, authorization seems to be working now. However, there's a new error:
2018-04-04T19:48:15.9263359Z Trying to fetch authentication token from system... 2018-04-04T19:48:15.9273357Z Using OAuth Access Token 2018-04-04T19:48:15.9273357Z Build shall be triggered for same user that triggered current build: Jeff 2018-04-04T19:48:15.9273357Z Using same branch as source version: $/ASR-TRS 2018-04-04T19:48:15.9273357Z ##[debug]Sending Request to following url: 2018-04-04T19:48:15.9273357Z ##[debug]build/definitions?api-version=2.0&name=hello%20poc 2018-04-04T19:48:15.9453368Z ##[debug]task result: Failed 2018-04-04T19:48:15.9453368Z ##[error]Not Found 2018-04-04T19:48:15.9453368Z ##[debug]Processed: ##vso[task.issue type=error;]Not Found 2018-04-04T19:48:15.9453368Z ##[debug]Processed: ##vso[task.complete result=Failed;]Not Found 2018-04-04T19:48:15.9553366Z ##[section]Finishing: Trigger a new build of hello poc
Let me know if this should be opened in a new thread.
Thanks.
Hi
ok that's good to hear. Hmm could you provide me the complete log of the Task after setting the system.debug variable to true? Then I might be able to draw some conclusion on what the issue might be
As requested. Thanks again for your excellent support.
2018-04-03T22:59:56.7720647Z ##[debug]Evaluating condition for step: 'Trigger a new build of scheduler' 2018-04-03T22:59:56.7720647Z ##[debug]Evaluating: succeeded() 2018-04-03T22:59:56.7720647Z ##[debug]Evaluating succeeded: 2018-04-03T22:59:56.7720647Z ##[debug]=> (Boolean) True 2018-04-03T22:59:56.7720647Z ##[debug]Expanded: True 2018-04-03T22:59:56.7720647Z ##[debug]Result: True 2018-04-03T22:59:56.7720647Z ##[section]Starting: Trigger a new build of scheduler 2018-04-03T22:59:56.7720647Z ============================================================================== 2018-04-03T22:59:56.7720647Z Task : Trigger Build 2018-04-03T22:59:56.7720647Z Description : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not. 2018-04-03T22:59:56.7720647Z Version : 2.7.2 2018-04-03T22:59:56.7720647Z Author : Benjamin Huser 2018-04-03T22:59:56.7720647Z Help : 2018-04-03T22:59:56.7720647Z ============================================================================== 2018-04-03T22:59:57.3502028Z ##[debug]agent.TempDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work_temp 2018-04-03T22:59:57.3658254Z ##[debug]loading inputs and endpoints 2018-04-03T22:59:57.3658254Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2018-04-03T22:59:57.3658254Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2018-04-03T22:59:57.3658254Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_BLOCKINPROGRESSBUILDS 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_BUILDDEFINITION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_DROPDIRECTORY 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_USESAMEBRANCH 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_USESAMESOURCEVERSION 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH 2018-04-03T22:59:57.3658254Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME 2018-04-03T22:59:57.3658254Z ##[debug]loading SECRET_WINRMPWD 2018-04-03T22:59:57.3814556Z ##[debug]loaded 22 2018-04-03T22:59:57.3814556Z ##[debug]Agent.ProxyUrl=undefined 2018-04-03T22:59:57.3814556Z ##[debug]Agent.CAInfo=undefined 2018-04-03T22:59:57.3814556Z ##[debug]Agent.ClientCert=undefined 2018-04-03T22:59:57.3814556Z ##[debug]Agent.SkipCertValidation=undefined 2018-04-03T22:59:57.3814556Z ##[debug]definitionIsInCurrentTeamProject=true 2018-04-03T22:59:57.3814556Z ##[debug]tfsServer=null 2018-04-03T22:59:57.3814556Z ##[debug]buildDefinition=scheduler 2018-04-03T22:59:57.3814556Z ##[debug]ignoreSslCertificateErrors=true 2018-04-03T22:59:57.3814556Z ##[debug]queueBuildForUserThatTriggeredBuild=true 2018-04-03T22:59:57.3814556Z ##[debug]useSameSourceVersion=false 2018-04-03T22:59:57.3814556Z ##[debug]useSameBranch=true 2018-04-03T22:59:57.3814556Z ##[debug]branchToUse=null 2018-04-03T22:59:57.3814556Z ##[debug]waitForQueuedBuildsToFinish=false 2018-04-03T22:59:57.3814556Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=60 2018-04-03T22:59:57.3814556Z ##[debug]failTaskIfBuildsNotSuccessful=true 2018-04-03T22:59:57.3814556Z ##[debug]downloadBuildArtifacts=false 2018-04-03T22:59:57.3814556Z ##[debug]dropDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work 2018-04-03T22:59:57.3814556Z ##[debug]storeInEnvironmentVariable=false 2018-04-03T22:59:57.3814556Z ##[debug]demands=null 2018-04-03T22:59:57.3814556Z ##[debug]queueid=null 2018-04-03T22:59:57.3814556Z ##[debug]buildParameters=null 2018-04-03T22:59:57.3814556Z ##[debug]authenticationMethod=OAuth Token 2018-04-03T22:59:57.3814556Z ##[debug]username=null 2018-04-03T22:59:57.3814556Z ##[debug]****=null 2018-04-03T22:59:57.3814556Z ##[debug]enableBuildInQueueCondition=false 2018-04-03T22:59:57.3814556Z ##[debug]includeCurrentBuildDefinition=true 2018-04-03T22:59:57.3814556Z ##[debug]blockingBuildsList=null 2018-04-03T22:59:57.3814556Z ##[debug]blockInProgressBuilds=false 2018-04-03T22:59:57.3814556Z ##[debug]dependentOnSuccessfulBuildCondition=false 2018-04-03T22:59:57.3814556Z ##[debug]dependentBuildsList=null 2018-04-03T22:59:57.3814556Z ##[debug]dependentOnFailedBuildCondition=false 2018-04-03T22:59:57.3814556Z ##[debug]dependentFailingBuildsList=null 2018-04-03T22:59:57.3814556Z Using current Team Project Url 2018-04-03T22:59:57.3814556Z Path to Server: http://xxxx:8080/tfs/EPC%20dev/ASR-TRS 2018-04-03T22:59:57.3814556Z Trying to fetch authentication token from system... 2018-04-03T22:59:57.3970775Z Using OAuth Access Token 2018-04-03T22:59:57.3970775Z Build shall be triggered for same user that triggered current build: Jeff 2018-04-03T22:59:57.3970775Z Using same branch as source version: $/ASR-TRS 2018-04-03T22:59:57.3970775Z ##[debug]Sending Request to following url: 2018-04-03T22:59:57.3970775Z ##[debug]build/definitions?api-version=2.0&name=scheduler 2018-04-03T22:59:57.4283285Z ##[debug]task result: Failed 2018-04-03T22:59:57.4283285Z ##[error]Not Found 2018-04-03T22:59:57.4283285Z ##[debug]Processed: ##vso[task.issue type=error;]Not Found 2018-04-03T22:59:57.4283285Z ##[debug]Processed: ##vso[task.complete result=Failed;]Not Found 2018-04-03T22:59:57.4283285Z ##[section]Finishing: Trigger a new build of scheduler
Hi
thanks for the log. I thought it might be an issue that it can't find a build definition with the name you supplied "scheduler". However I double checked and if that happens we actually get a proper message back that it wasn't able to find something.
For me it looks that for some reason it fails to even send the Request to the TFS API. If you compare with the code that normally runs you see this:
build/definitions?api-version=2.0&name=Whatever
Result:
{"count":0,"value":[]}
task result: Failed
Did not find any build definition with this name: Whatever
So it fails right on sending the request itself. Could you try once if you can execute the same request manually (for example via browser or a tool like Postman). Just query the following URL and see what is coming back from the server: http://xxxx:8080/tfs/EPC%20dev/ASR-TRS/_apis/build/definitions?api-version=2.0&name=scheduler
{ "count": 1, "value": [ { "_links": { "self": { "href": "http://xxxx:8080/tfs/EPC%20dev/f2713537-d2fa-4854-bf4f-7cf96d23fc97/_apis/build/Definitions/8" }, "web": { "href": "http://xxxx:8080/tfs/_permalink/_build/index?collectionId=2221e464-3fb8-4e76-80de-4daa7fa0c421&projectId=f2713537-d2fa-4854-bf4f-7cf96d23fc97&definitionId=8" }, "editor": { "href": "http://xxxx:8080/tfs/_permalink/_build/definitionEditor?collectionId=2221e464-3fb8-4e76-80de-4daa7fa0c421&projectId=f2713537-d2fa-4854-bf4f-7cf96d23fc97&definitionId=8" } }, "quality": "definition", "authoredBy": { "id": "e43fed96-e63e-422e-aaa4-9b6e3ef0fb47", "displayName": "Jeff Yoder", "uniqueName": "EPC\dsvyoder", "url": "http://xxxx:8080/tfs/EPC dev/_apis/Identities/e43fed96-e63e-422e-aaa4-9b6e3ef0fb47", "imageUrl": "http://xxxx:8080/tfs/EPC dev/_api/_common/identityImage?id=e43fed96-e63e-422e-aaa4-9b6e3ef0fb47" }, "queue": { "id": 1, "name": "Default", "pool": { "id": 1, "name": "Default" } }, "id": 8, "name": "scheduler", "url": "http://xxxx:8080/tfs/EPC%20dev/f2713537-d2fa-4854-bf4f-7cf96d23fc97/_apis/build/Definitions/8", "uri": "vstfs:///Build/Definition/8", "path": "\", "type": "build", "queueStatus": "enabled", "revision": 92, "createdDate": "2018-03-19T23:59:39.37Z", "project": { "id": "f2713537-d2fa-4854-bf4f-7cf96d23fc97", "name": "ASR-TRS", "description": "Applications for the assessor and treasurer departments.", "url": "http://xxxx:8080/tfs/EPC dev/_apis/projects/f2713537-d2fa-4854-bf4f-7cf96d23fc97", "state": "wellFormed", "revision": 25, "visibility": "private" } } ] }
Hi thanks for the log. Thats quite strange, so you actually get the definition manually.
Could you maybe give it a try with the newest version of the Task (2.8.0) with system.debug set to true? I added some error handling for the request and maybe we get out a better error message to figure out where the problem lies.
If you can do it manually from your machine, the error most likely is in the configuration of the agent. Maybe there is some firewall or something blocking it? Or do you need some proxy to access the server? This for example seemed to have been the problem in this issue: https://github.com/huserben/TfsExtensions/issues/59
2018-04-08T00:48:26.8680599Z ##[section]Starting: Trigger a new build of scheduler
2018-04-08T00:48:26.8680599Z ==============================================================================
2018-04-08T00:48:26.8680599Z Task : Trigger Build
2018-04-08T00:48:26.8680599Z Description : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not.
2018-04-08T00:48:26.8680599Z Version : 2.8.0
2018-04-08T00:48:26.8680599Z Author : Benjamin Huser
2018-04-08T00:48:26.8680599Z Help :
2018-04-08T00:48:26.8680599Z ==============================================================================
2018-04-08T00:48:27.6024696Z Using current Team Project Url
2018-04-08T00:48:27.6024696Z Path to Server: http://vrtwprbuild01:8080/tfs/EPC%20dev/ASR-TRS
2018-04-08T00:48:27.6024696Z Trying to fetch authentication token from system...
2018-04-08T00:48:27.6024696Z Using OAuth Access Token
2018-04-08T00:48:27.6024696Z Build shall be triggered for same user that triggered current build: Marco Biswas
2018-04-08T00:48:27.6024696Z Using same branch as source version: $/ASR-TRS
2018-04-08T00:48:27.6649680Z Request was not successful.
2018-04-08T00:48:27.6962434Z { Error: Not Found
2018-04-08T00:48:27.6962434Z at ResponseError (D:\tmp\vsts-agent-win7-x64-2.122.1_work_tasks\TriggerBuild_32abcf98-0df6-4711-b2e4-66a405d3c1a6\2.8.0\node_modules\web-request\index.js:146:9)
2018-04-08T00:48:27.6962434Z at Request.request [as _callback] (D:\tmp\vsts-agent-win7-x64-2.122.1_work_tasks\TriggerBuild_32abcf98-0df6-4711-b2e4-66a405d3c1a6\2.8.0\node_modules\web-request\index.js:58:28)
2018-04-08T00:48:27.6962434Z at Request.self.callback (D:\tmp\vsts-agent-win7-x64-2.122.1_work_tasks\TriggerBuild_32abcf98-0df6-4711-b2e4-66a405d3c1a6\2.8.0\node_modules\request\request.js:186:22)
2018-04-08T00:48:27.6962434Z at emitTwo (events.js:106:13)
2018-04-08T00:48:27.6962434Z at Request.emit (events.js:191:7)
2018-04-08T00:48:27.6962434Z at Request.HTTP Error 404.11 - Not Found
\n The request filtering module is configured to deny a request that contains a double escape sequence.
\nHTTP Error 404.11 - Not Found
\n The request filtering module is configured to deny a request that contains a double escape sequence.
\n
Hmm looking at the message now maybe this "double escaped url" is a problem. I just quickly googled it and came up with this: https://support.microsoft.com/en-us/help/942076/error-message-when-you-visit-a-web-site-that-is-hosted-on-iis-7-0-http Maybe that's worth a try.
Other than that, do you have access to the build agent that you are running the build on. If so, could you please log in there (e.g. via rdp) and try to send the request manually from the agent and see if you get a response.
I changed the double escaped URL configuration as instructed in the link. Same result.
The build agent is on the same server as TFS. Everything is within our organization's intranet. I don't know how to send the request manually.
We do have a new security team. I wonder if they've fiddled with something.
Oh ok, too bad. Honestly I've never seen that error before and it feels like it has to be some setting on your TFS/IIS side (as it works on other TFS instances).
To send the request manually, just log on to the build agent, start a browser and open the url as you did in https://github.com/huserben/TfsExtensions/issues/61#issuecomment-379928418
Otherwise maybe you could check with your security team. I'm not really familiar with setting up and configuring TFS/IIS.
Hi @userjeff3
was there any development on your issue? Or is it still the same problem?
Sorry, I've been pulled away onto other projects and haven't been able to try your last suggestion.
Allright, just let me know in case you find something else out and I could assist in any way.
HI @huserben Great TfsExtensions. Thanks a bunch!!! Weird thing is, i have to specify a PAT when triggering a build within the same collection. The OAuth does not access the authorization. It there no way to get it to work without speficifying and deslaying may OAuth or PAT? Do i need a special setup on the tfs to get the default OAuth to be accespted?
Hi @generik0
I think OAuth should work out of the box, you just need to make sure that the build definition has access to it (see the docs for more info).
Closed due to inactivity - please reopen if it's still an issue
I'm using TFS 2018 on-premise. I don't understand why there are authentication requirements for this task as I've never had to fool with any such thing before. Anyway, the error is: "Authentication with TFS Server failed. Please check your settings." I've read the overview, enabled "Allow scripts to access oauth token", and tried every option to no avail. From the log of the latest attempt:
2018-03-22T00:14:55.2978827Z ##[debug]Evaluating condition for step: 'Trigger a new build of schedulerx' 2018-03-22T00:14:55.2978827Z ##[debug]Evaluating: succeeded() 2018-03-22T00:14:55.2978827Z ##[debug]Evaluating succeeded: 2018-03-22T00:14:55.2978827Z ##[debug]=> (Boolean) True 2018-03-22T00:14:55.2978827Z ##[debug]Expanded: True 2018-03-22T00:14:55.2978827Z ##[debug]Result: True 2018-03-22T00:14:55.2978827Z ##[section]Starting: Trigger a new build of schedulerx 2018-03-22T00:14:55.2978827Z ============================================================================== 2018-03-22T00:14:55.2978827Z Task : Trigger Build 2018-03-22T00:14:55.2978827Z Description : This tasks allows to trigger a new Build (add it to the queue) as part of a Build Definition. It contains as well some conditions that can be applied, for example if the last build of certain definition was successful or not. 2018-03-22T00:14:55.2978827Z Version : 2.7.1 2018-03-22T00:14:55.2978827Z Author : Benjamin Huser 2018-03-22T00:14:55.2978827Z Help : 2018-03-22T00:14:55.2978827Z ============================================================================== 2018-03-22T00:14:55.9854659Z ##[debug]agent.TempDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work_temp 2018-03-22T00:14:56.0009898Z ##[debug]loading inputs and endpoints 2018-03-22T00:14:56.0009898Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2018-03-22T00:14:56.0009898Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2018-03-22T00:14:56.0009898Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_AUTHENTICATIONMETHOD 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_BLOCKINPROGRESSBUILDS 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_BUILDDEFINITION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_DEFINITIONISINCURRENTTEAMPROJECT 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_DEPENDENTONFAILEDBUILDCONDITION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_DEPENDENTONSUCCESSFULBUILDCONDITION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_DOWNLOADBUILDARTIFACTS 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_DROPDIRECTORY 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_ENABLEBUILDINQUEUECONDITION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_FAILTASKIFBUILDSNOTSUCCESSFUL 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_IGNORESSLCERTIFICATEERRORS 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_INCLUDECURRENTBUILDDEFINITION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_QUEUEBUILDFORUSERTHATTRIGGEREDBUILD 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_STOREINENVIRONMENTVARIABLE 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_USESAMEBRANCH 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_USESAMESOURCEVERSION 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISH 2018-03-22T00:14:56.0009898Z ##[debug]loading INPUT_WAITFORQUEUEDBUILDSTOFINISHREFRESHTIME 2018-03-22T00:14:56.0009898Z ##[debug]loading SECRET_WINRMPWD 2018-03-22T00:14:56.0009898Z ##[debug]loaded 22 2018-03-22T00:14:56.0009898Z ##[debug]Agent.ProxyUrl=undefined 2018-03-22T00:14:56.0009898Z ##[debug]Agent.CAInfo=undefined 2018-03-22T00:14:56.0009898Z ##[debug]Agent.ClientCert=undefined 2018-03-22T00:14:56.0009898Z ##[debug]Agent.SkipCertValidation=undefined 2018-03-22T00:14:56.0009898Z ##[debug]definitionIsInCurrentTeamProject=true 2018-03-22T00:14:56.0009898Z ##[debug]tfsServer=null 2018-03-22T00:14:56.0009898Z ##[debug]buildDefinition=schedulerx 2018-03-22T00:14:56.0009898Z ##[debug]ignoreSslCertificateErrors=false 2018-03-22T00:14:56.0009898Z ##[debug]queueBuildForUserThatTriggeredBuild=true 2018-03-22T00:14:56.0009898Z ##[debug]useSameSourceVersion=true 2018-03-22T00:14:56.0009898Z ##[debug]useSameBranch=true 2018-03-22T00:14:56.0009898Z ##[debug]branchToUse=null 2018-03-22T00:14:56.0009898Z ##[debug]waitForQueuedBuildsToFinish=false 2018-03-22T00:14:56.0009898Z ##[debug]waitForQueuedBuildsToFinishRefreshTime=60 2018-03-22T00:14:56.0166164Z ##[debug]failTaskIfBuildsNotSuccessful=true 2018-03-22T00:14:56.0166164Z ##[debug]downloadBuildArtifacts=false 2018-03-22T00:14:56.0166164Z ##[debug]dropDirectory=D:\tmp\vsts-agent-win7-x64-2.122.1_work 2018-03-22T00:14:56.0166164Z ##[debug]storeInEnvironmentVariable=false 2018-03-22T00:14:56.0166164Z ##[debug]demands=null 2018-03-22T00:14:56.0166164Z ##[debug]queueid=null 2018-03-22T00:14:56.0166164Z ##[debug]buildParameters=null 2018-03-22T00:14:56.0166164Z ##[debug]authenticationMethod=OAuth Token 2018-03-22T00:14:56.0166164Z ##[debug]username=null 2018-03-22T00:14:56.0166164Z ##[debug]****=null 2018-03-22T00:14:56.0166164Z ##[debug]enableBuildInQueueCondition=false 2018-03-22T00:14:56.0166164Z ##[debug]includeCurrentBuildDefinition=true 2018-03-22T00:14:56.0166164Z ##[debug]blockingBuildsList=null 2018-03-22T00:14:56.0166164Z ##[debug]blockInProgressBuilds=false 2018-03-22T00:14:56.0166164Z ##[debug]dependentOnSuccessfulBuildCondition=false 2018-03-22T00:14:56.0166164Z ##[debug]dependentBuildsList=null 2018-03-22T00:14:56.0166164Z ##[debug]dependentOnFailedBuildCondition=false 2018-03-22T00:14:56.0166164Z ##[debug]dependentFailingBuildsList=null 2018-03-22T00:14:56.0166164Z Using current Team Project Url 2018-03-22T00:14:56.0166164Z Path to Server: http://vrtwprbuild01:8080/tfs/EPC%20dev/ASR-TRS 2018-03-22T00:14:56.0166164Z Trying to fetch authentication token from system... 2018-03-22T00:14:56.0166164Z Using OAuth Access Token 2018-03-22T00:14:56.0166164Z Build shall be triggered for same user that triggered current build: Jeff 2018-03-22T00:14:56.0166164Z Source Version: 3040 2018-03-22T00:14:56.0166164Z Triggered Build will use the same source version: C3040 2018-03-22T00:14:56.0166164Z Using same branch as source version: $/ASR-TRS 2018-03-22T00:14:56.0634897Z Authentication failed - please make sure your settings are correct. 2018-03-22T00:14:56.0634897Z If you use the OAuth Token, make sure you enabled the access to it on the Build Definition. 2018-03-22T00:14:56.0634897Z If you use a Personal Access Token, make sure it did not expire. 2018-03-22T00:14:56.0634897Z If you use Basic Authentication, make sure alternate credentials are enabled on your TFS/VSTS. 2018-03-22T00:14:56.0634897Z ##[debug]task result: Failed 2018-03-22T00:14:56.0634897Z ##[error]Authentication with TFS Server failed. Please check your settings. 2018-03-22T00:14:56.0634897Z ##[debug]Processed: ##vso[task.issue type=error;]Authentication with TFS Server failed. Please check your settings. 2018-03-22T00:14:56.0634897Z ##[debug]Processed: ##vso[task.complete result=Failed;]Authentication with TFS Server failed. Please check your settings. 2018-03-22T00:14:56.0634897Z ##[section]Finishing: Trigger a new build of schedulerx
Thanks.