TFS 2015.2 Work Item Creation Issue with custom build task

166 Views Asked by At

I can see following error logged in windows event log after initiating a build in TFS 2015.2 with a custom build task.

ds:xxxxxxx\SqlExpress db:Tfs_Configuration Msg:4060 Level:11 State:1 LineNumber:65536 Errors:4060;18456; Exception:Cannot open database "Tfs_Configuration" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\IUSR'. Command:EXEC Gallery.prc_QueryExtension publisherName=xxxxxxxx,extensionName=xxxxxx-build-extension,version=1.0.1,validationId=,flags=10 -------------------- SProcs:;; Messages:Cannot open database "Tfs_Configuration" requested by the login. The login failed.;Login failed for user 'NT AUTHORITY\IUSR'.;

The custom build task which use vso-node-api library is displaying following error message in build console.

Failed to create WorkItem 'xxxxxxxx' Error: Failed Request: Bad Request(400) - TF401349: An unexpected error has occurred, please verify your request and try again.

Is there a relation between these two logs? What is the reason for authentication issue?

Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

TFS 2015.3 doesn't support PAT token based authentication. Alternative is to use Basic Authentication option. If the extension should be compatible with both VSTS and TFS, then you have to create a mechanism to use separate authentication mechanism for each deployment scenario. TFS 2017 support token authentication so that it will work fine with the PAT just like VSTS.