Authorization error with Team Foundation and Hudson (and TeamCity) - tfs

I've browsed every post about TFS and Hudson I could find but nothing useful has popped up.
In Hudson when I attempt a build, the console output provides:
Started by user jlowder
[workspace] $ tf workspaces -format:brief -server:http://ashpteam01.hq.hanger.com:8080 **
TF30063: You are not authorized to access http://ashpteam01.hq.hanger.com:8080/.
FATAL: Executable returned an unexpected result code [100]
ERROR: null
[DEBUG] Skipping watched dependency update for build: NextGen Automation #25 due to result: FAILURE
Finished: FAILURE
If I manually run the tf command above from a command prompt, it works. I access TF from Visual Studio 2010 just fine.
I receive this error regardless if an attempt to access TFS comes from Hudson or Team City. My login to TFS is my domain user name and password, which I have checked and re-checked.
What am I missing here?

If you go to Control Panel > Network Passwords, are there any saved passwords there for your server? TFS will always try and authenticate using these first. If one is saved, and it is incorrect - you will get this error.
Also, what URL do you connect to in Visual Studio? Does it have a /tfs/ on the end?

It appears that the domain the server was running on would not send back to the domain I was requesting from. Moving hudson and tfs to same domain

Related

List Checked-Out Files from Azure DevOps / TFVC

I am trying to get a list of files checked out from my TFVC repository hosted on Azure DevOps. I am the administrator of the repository. I have a local workspace, and all file changes take place through Visual Studio (2017), which does a formal check-out of each file as I change it.
My plan was to use the "tf status" command to connect to and query the repository, but I can't get past authentication issues. I first tried this command.
tf status /Collection:https://example.visualstudio.com/MyProject /login:me#example.com,MyPassword
It responded with the error:
TF31002: Unable to connect to this Team Foundation Server: https://example.visualstudio.com/MyProject.
Team Foundation Server Url: https://example.visualstudio.com/MyProject.
Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.
Technical information (for administrator):
The remote server returned an error: (404) Not Found.
I tried to access the default collection:
tf status /Collection:https://example.visualstudio.com/DefaultCollection /login:me#example.com,MyPassword
This time, the error is different.
TF30063: You are not authorized to access https://example.visualstudio.com/DefaultCollection.
TF30063: You are not authorized to access https://example.visualstudio.com/DefaultCollection.
If I leave off the trailing collection name:
tf status /Collection:https://example.visualstudio.com /login:me#example.com,MyPassword
It returns a related error.
TF30063: You are not authorized to access example.visualstudio.com\example.
TF30063: You are not authorized to access example.visualstudio.com\example.
I found a similar question at tf.exe authenticate for vsts, but in that question, the OP was using an on-site TFS instance. My repository is only stored in VSTS / Azure DevOps.
How can I get a list of checked out files, that is, of files modified but not yet checked in from my local workspace?

TFS Build failed due to InstallShield Exception

We are using InstallShield 2013 Limited Edition with TFS 2013 Build Server.
Occasionally our tfs XAML builds failed with error:
C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets (108): Exception Caught
License of InstallShield 2013 Limited Edition is successfully activated on Build Server Machine(WIN 7 machine).
Due to this error, complete build failed. To fix this, we need to restart tfs build server machine.
Please suggestion some permanent fix for this issue. Let me know if need any additional information.
If you get error saying InstallShield.Tasks.dll was not found or could not be loaded like screenshot below:
Solution:
Set the MSBuild Platform on your Build Definition to “X86” as shown
below:
If you get error saying InstallShield Licence has expired like screenshot below:
Solution:
Set your Build Service to run with a domain account instead of
“NT_AUTHORITY\Network Service”.

How to get fix "You are not authorized to access" accessing VS Team Services

I can open internet explorer and login just fine.
Credentials are saved in the credential manager.
Trying to access any tf.exe command results in a TF30063 error.
I do not have VS installed on this machine.
Any suggestions on what to try?
UPDATE:
Here are the step I've taken to get this error.
Login to VS Team Services via IE
At the command prompt:
C:\>tf.exe status /collection:https://xxxxx.visualstudio.com/DefaultCollection
C:\>tf.exe workspaces /collection:https://xxxxx.visualstudio.com
C:\>tf.exe workspace /new /collection:https://xxxxx.visualstudio.com
I've also tried a few others and everyone of them return with the same unauthorized error.
These commands all work on another server that's connected to the same tfs repo with the same credentials, which leads me to believe it's something in IE and/or internet security options.
Taking add files and folders to version control as example, you can specify the user account /login:username,[password] in the command:
tf add itemspec [/lock:(none|checkin|checkout)] [/encoding:filetype]
[/noprompt] [/recursive] [/noignore] [/login:username,[password]]
More commands, see: https://www.visualstudio.com/en-us/docs/tfvc/use-team-foundation-version-control-commands
To use tf.exe command, you need either Visual Studio or Team Explorer is installed. More details please refer Command-line tools for TFS

Jenkins Error Connecting to Visual Studio Online

I am running Jenkins 1.595 with the TFS plugin 3.1.1 and TEE 12.0.2
I have been running jobs on Jenkins with Visual Studio Online for some time without issue, but I recently modified an existing job to point at a new branch and it stopped working. After much troubleshooting, I decided to stand up a brand new instance.
Right now in the new instance, I am getting the same error that I was getting in the old broken job.
An error occurred: TF14045: The identity grobocop is not a recognized identity.
(grobocop is an alternate credential associated to my MSDN account)
Looking at the command Jenkins is sending, I noticed that the workspace owner is specified after the workspace name which should not be a problem.
$ C:\TEE-CLC-12.0.2\tf.cmd workspace -new "Stage Author-MASTER;grobocop" -noprompt
-server:https://XXXXX.visualstudio.com/DefaultCollection ********
Running this same command in the command line produces the same error, but without the workspace owner, I get the prompts for username/password and the workspace is created.
Does anyone have any idea what is going on here?
I would recommend either dropping grobocop from the argument to new or you need to fully qualify it - grobocop#whatever.com. Grobocop by itself won't be accepted as the identity.

Unable to login to TFS 2010 through jenkins

Was able to connect to TFS 2008. After the upgrade to TFS 2010, I am unable to connect.
I reconfigured jenkins to use the new VS2010 tf.exe.
I reconfigured my job to point ot the new URL.
Verified my password is correct...
Within visual studio I can connect and use TFS 2010 without any problems.
However I am getting permissions problesm when trying to use Jenkins.
I have updated to version 1.20 of the TFS plugin and the problem still persists.
I have restarted the service before and after configuration changes...
Any ideas on what might be wrong? I changed the group/account in the log for safety.
Log is:
[workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" workspaces -format:brief -server:http://sbn01p-tfs1001v:8080/tfs ********
TF50309: The following account does not have sufficient permissions to complete the operation: <group>\<my account>. The following permissions are needed to perform this operation: View collection-level information.
FATAL: Executable returned an unexpected result code [100]
ERROR: null
Team Foundation Server, beginning with TFS 2010, adds a new concept called Team Project Collections. Your Team Project Collection needs to be specified in the URI, for example:
http://sbn01p-tfs1001v:8080/tfs/DefaultCollection

Resources