com.microsoft.tfs.core.exceptions.TFSUnauthorizedException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • If the username and password are manually entered into a job configuration page then the plugin will properly authorize with TFS and jobs will complete on both Master and slaves. If the username and password are left blank to use the service credentials of the Jenkins Service, the all operations including the source code download will complete, but the call to tf.exe history will fail with an unauthorized exception. The issue may be similar to JENKINS-22046 but unsure. Inability to use service credentials is a problem because it rules out the use of Managed Service accounts, and requires lots of jobs to be updated if the credentials change (another reason to use Managed Service Accounts). FATAL: Access denied connecting to TFS server <servername> (authenticating as ) com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server http://pmtfs3:8080/ (authenticating as ) at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75) at com.microsoft.tfs.core.exceptions.mappers.LocationExceptionMapper.map(LocationExceptionMapper.java:32) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:76) at com.microsoft.tfs.core.clients.framework.location.LocationService.connect(LocationService.java:754) at com.microsoft.tfs.core.clients.framework.location.LocationService.ensureConnected(LocationService.java:884) at com.microsoft.tfs.core.clients.framework.location.LocationService.getInstanceID(LocationService.java:943) at com.microsoft.tfs.core.TFSConnection.getInstanceID(TFSConnection.java:533) at com.microsoft.tfs.core.clients.webservices.IdentityManagementService.<init>(IdentityManagementService.java:85) at hudson.plugins.tfs.model.Project.getVCCHistory(Project.java:84) at hudson.plugins.tfs.model.Project.getDetailedHistory(Project.java:128) at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:56) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1751) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'http://pmtfs3:8080/tfs/DefaultCollection/Services/v3.0/LocationService.asmx' (authenticating as ) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473) at ms.ws._LocationWebServiceSoap12Service.connect(_LocationWebServiceSoap12Service.java:384) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:70) ... 17 more Finished: FAILURE
    via by Bill Hurt,
  • If the username and password are manually entered into a job configuration page then the plugin will properly authorize with TFS and jobs will complete on both Master and slaves. If the username and password are left blank to use the service credentials of the Jenkins Service, the all operations including the source code download will complete, but the call to tf.exe history will fail with an unauthorized exception. The issue may be similar to JENKINS-22046 but unsure. Inability to use service credentials is a problem because it rules out the use of Managed Service accounts, and requires lots of jobs to be updated if the credentials change (another reason to use Managed Service Accounts). FATAL: Access denied connecting to TFS server <servername> (authenticating as ) com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server http://pmtfs3:8080/ (authenticating as ) at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75) at com.microsoft.tfs.core.exceptions.mappers.LocationExceptionMapper.map(LocationExceptionMapper.java:32) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:76) at com.microsoft.tfs.core.clients.framework.location.LocationService.connect(LocationService.java:754) at com.microsoft.tfs.core.clients.framework.location.LocationService.ensureConnected(LocationService.java:884) at com.microsoft.tfs.core.clients.framework.location.LocationService.getInstanceID(LocationService.java:943) at com.microsoft.tfs.core.TFSConnection.getInstanceID(TFSConnection.java:533) at com.microsoft.tfs.core.clients.webservices.IdentityManagementService.<init>(IdentityManagementService.java:85) at hudson.plugins.tfs.model.Project.getVCCHistory(Project.java:84) at hudson.plugins.tfs.model.Project.getDetailedHistory(Project.java:128) at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:56) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1751) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'http://pmtfs3:8080/tfs/DefaultCollection/Services/v3.0/LocationService.asmx' (authenticating as ) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473) at ms.ws._LocationWebServiceSoap12Service.connect(_LocationWebServiceSoap12Service.java:384) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:70) ... 17 more Finished: FAILURE
    via by Bill Hurt,
  • Error creating a new workspace
    via Stack Overflow by ShaggyInjun
    ,
  • I have configured Jenkins to poll and build my project at http://myproject.visualstudio.com, where I log in with my Windows Live account and password, which work through Visual Studio, so I know my credentials are correct. Even though Jenkins successfully retrieves the source code, it then fails with an exception, claiming access is denied. Started by user Arnoud Building in workspace C:\Program Files (x86)\Jenkins\jobs\KING\workspace [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspaces -format:brief -server:https://************.visualstudio.com/DefaultCollection ******** Collection: https://************.visualstudio.com/DefaultCollection Workspace Owner Computer Comment ------------------ ---------------- --------------- --------------------------- BA91-CNU2192K64 Arnoud Berendsen BA91-CNU2192K64 Hudson-KING-MASTER Arnoud Berendsen BA91-CNU2192K64 [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspace -delete Hudson-KING-MASTER;arnoudb@*********.nl -noprompt -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspace -new Hudson-KING-MASTER;arnoudb@*********.nl -noprompt -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workfold -map "$/myprojectname/Sources" "C:\Program Files (x86)\Jenkins\jobs\KING\workspace" -workspace:Hudson-KING-MASTER -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" get . -recursive -version:D2014-03-05T14:23:20Z -noprompt ******** C:\Program Files (x86)\Jenkins\jobs\KING: Getting workspace C:\Program Files (x86)\Jenkins\jobs\KING\workspace: Getting [...] [--cut the list of files--] [...] C:\Program Files (x86)\Jenkins\jobs\KING\workspace\TestProjects\myproject.TestCoreClasses\Properties: Getting AssemblyInfo.cs FATAL: Access denied connecting to TFS server https://********.visualstudio.com/ (authenticating as arnoudb@*********.nl) com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server https://************.visualstudio.com/ (authenticating as arnoudb@*********.nl) at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75) at com.microsoft.tfs.core.exceptions.mappers.RegistrationExceptionMapper.map(RegistrationExceptionMapper.java:23) at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:70) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationData(RegistrationClient.java:645) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntry(RegistrationClient.java:188) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntry(RegistrationClient.java:167) at com.microsoft.tfs.core.clients.webservices.IdentityManagementService.<init>(IdentityManagementService.java:65) at hudson.plugins.tfs.model.Project.getVCCHistory(Project.java:84) at hudson.plugins.tfs.model.Project.getDetailedHistory(Project.java:128) at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:56) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176) at hudson.model.AbstractProject.checkout(AbstractProject.java:1414) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:671) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1676) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'https://************.visualstudio.com/DefaultCollection/Services/v1.0/Registration.asmx' (authenticating as arnoudb@*********.nl) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473) at ms.tfs.services.registration._03._RegistrationSoap12Service.getRegistrationEntries(_RegistrationSoap12Service.java:105) at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:65) ... 16 more
    via by Arnoud Berendsen,
  • I have configured Jenkins to poll and build my project at http://myproject.visualstudio.com, where I log in with my Windows Live account and password, which work through Visual Studio, so I know my credentials are correct. Even though Jenkins successfully retrieves the source code, it then fails with an exception, claiming access is denied. Started by user Arnoud Building in workspace C:\Program Files (x86)\Jenkins\jobs\KING\workspace [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspaces -format:brief -server:https://************.visualstudio.com/DefaultCollection ******** Collection: https://************.visualstudio.com/DefaultCollection Workspace Owner Computer Comment ------------------ ---------------- --------------- --------------------------- BA91-CNU2192K64 Arnoud Berendsen BA91-CNU2192K64 Hudson-KING-MASTER Arnoud Berendsen BA91-CNU2192K64 [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspace -delete Hudson-KING-MASTER;arnoudb@*********.nl -noprompt -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workspace -new Hudson-KING-MASTER;arnoudb@*********.nl -noprompt -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" workfold -map "$/myprojectname/Sources" "C:\Program Files (x86)\Jenkins\jobs\KING\workspace" -workspace:Hudson-KING-MASTER -server:https://************.visualstudio.com/DefaultCollection ******** [workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe" get . -recursive -version:D2014-03-05T14:23:20Z -noprompt ******** C:\Program Files (x86)\Jenkins\jobs\KING: Getting workspace C:\Program Files (x86)\Jenkins\jobs\KING\workspace: Getting [...] [--cut the list of files--] [...] C:\Program Files (x86)\Jenkins\jobs\KING\workspace\TestProjects\myproject.TestCoreClasses\Properties: Getting AssemblyInfo.cs FATAL: Access denied connecting to TFS server https://********.visualstudio.com/ (authenticating as arnoudb@*********.nl) com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server https://************.visualstudio.com/ (authenticating as arnoudb@*********.nl) at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75) at com.microsoft.tfs.core.exceptions.mappers.RegistrationExceptionMapper.map(RegistrationExceptionMapper.java:23) at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:70) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationData(RegistrationClient.java:645) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntry(RegistrationClient.java:188) at com.microsoft.tfs.core.clients.registration.RegistrationClient.getRegistrationEntry(RegistrationClient.java:167) at com.microsoft.tfs.core.clients.webservices.IdentityManagementService.<init>(IdentityManagementService.java:65) at hudson.plugins.tfs.model.Project.getVCCHistory(Project.java:84) at hudson.plugins.tfs.model.Project.getDetailedHistory(Project.java:128) at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:56) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176) at hudson.model.AbstractProject.checkout(AbstractProject.java:1414) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:671) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1676) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'https://************.visualstudio.com/DefaultCollection/Services/v1.0/Registration.asmx' (authenticating as arnoudb@*********.nl) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473) at ms.tfs.services.registration._03._RegistrationSoap12Service.getRegistrationEntries(_RegistrationSoap12Service.java:105) at com.microsoft.tfs.core.clients.registration.RegistrationData.newFromServer(RegistrationData.java:65) ... 16 more
    via by Arnoud Berendsen,
  • Team Explorer Anywhere fails from Ubuntu Linux
    via by Unknown author,
    • com.microsoft.tfs.core.exceptions.TFSUnauthorizedException: Access denied connecting to TFS server http://pmtfs3:8080/ (authenticating as ) at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:75) at com.microsoft.tfs.core.exceptions.mappers.LocationExceptionMapper.map(LocationExceptionMapper.java:32) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:76) at com.microsoft.tfs.core.clients.framework.location.LocationService.connect(LocationService.java:754) at com.microsoft.tfs.core.clients.framework.location.LocationService.ensureConnected(LocationService.java:884) at com.microsoft.tfs.core.clients.framework.location.LocationService.getInstanceID(LocationService.java:943) at com.microsoft.tfs.core.TFSConnection.getInstanceID(TFSConnection.java:533) at com.microsoft.tfs.core.clients.webservices.IdentityManagementService.<init>(IdentityManagementService.java:85) at hudson.plugins.tfs.model.Project.getVCCHistory(Project.java:84) at hudson.plugins.tfs.model.Project.getDetailedHistory(Project.java:128) at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:56) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:176) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1751) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: com.microsoft.tfs.core.ws.runtime.exceptions.UnauthorizedException: Authorization failure connecting to 'http://pmtfs3:8080/tfs/DefaultCollection/Services/v3.0/LocationService.asmx' (authenticating as ) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:709) at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473) at ms.ws._LocationWebServiceSoap12Service.connect(_LocationWebServiceSoap12Service.java:384) at com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.connect(LocationWebServiceProxy.java:70) ... 17 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,