Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Error: command 'team.signin' not found [mapped drive] #245

Closed
BrianFarnhill opened this issue May 29, 2017 · 13 comments
Closed

Error: command 'team.signin' not found [mapped drive] #245

BrianFarnhill opened this issue May 29, 2017 · 13 comments

Comments

@BrianFarnhill
Copy link

I have just installed the extension at v1.118.2 with VS Code v1.12.2. I set the tfvc location in settings.json as per the instructions, but when I run "team signin" I get the following error:

command 'team.signin' not found

Any ideas on what I need to check to get this working?

@jeffyoung
Copy link
Contributor

Hi @BrianFarnhill. Thanks for trying out the extension.

I've tried to catch all of the issues where commands just fail in this manner but must have missed (at least) one scenario. This isn't supposed to happen.

Can you tell me more about your situation?

  • After installing the extension, have you opened a folder?
  • If so, does the folder contain a TFVC workspace?
  • If so, can you run tf workfold from the command line in that folder?
  • Could you enable debug logging and provide any details here?
  • Which OS are you running on?
  • If you're on Windows, are you running an ENU version of TF.exe? (I've had issues in the past here but have tried to detect them as best as I can.)

We've had #160 but didn't actually get to the root cause of the problem.

@BrianFarnhill
Copy link
Author

Thanks for the response @jeffyoung some responses to your questions:

  1. After installing the extension I open a folder that has a workspace in it that I created from the command line with tf.exe
  2. When I run tf workfold it returns the workspace, collection and mapped path for the folder
  3. I'm on Windows 7 SP1
  4. Yes its the ENU version of TF.exe, installed from the Team Explorer 2017 package

I'll enable the debug logging now and see what that turns up, I'll post here with the details

@BrianFarnhill
Copy link
Author

I've turned on the debugging and I can see the team-extension.log file gets created but nothing appears to be written to it when I try to sign in or perform other actions (all the other actions also trigger the "command not found" error).

Now it's also worth noting that the environment I'm seeing this in is reasonably tightly locked down as well, lots of outbound firewall rules to prevent traffic kicking around and limited permissions to things on the local system. I'm not sure if that should make a difference but I felt it worth calling out just in case there are other things I should be checking. I did test things by disabling the firewall and that didn't resolve the issue, and I've also run things up as a local admin and still get the same result.

@jeffyoung
Copy link
Contributor

Hi @BrianFarnhill. It's good to know about the limited permissions on the local system. That makes me think of a few things.

A few follow up questions:

  • Can you successfully run other VS Code extensions? For example, https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons. If so, that would at least tell me you have access to the folder that VS Code extensions get expanded into (I would expect you would since the folder they go into is under your user account, C:\Users<username>.vscode\extensions).
  • Did you set the logging level to "debug"? One of the very first things we do is set up the log file and log a line that looks like this "*** FOLDER: c:\repos\vsts-vscode ***". If you have "debug" set up and even that's not working, then something 'catastrophic' would be going on (like the extension isn't being successfully loaded; it appears to be in some inconsistent state because it knows about the commands (which it can get from the package.json file) but it can't find the code to call behind that method (which is set up in the first source file it should run)). Have another look at the team-extension.log file (even after closing VS Code) and see if you get any results.

@BrianFarnhill
Copy link
Author

@jeffyoung Thanks for the follow, in respose:

  • Yes I can run other extensions, in this customers environment we have Git Blame and the PowerShell extensions in and running.
  • The setting "team.logging.level" is set to "debug", when I re-open the folder that has my workspace in it then I see it create the team-extension.log file (even if I delete it and then re-open the workspace it will create it again) but the file never has anything written to it.

So based on what you're saying I feel like what youa re saying about it knowing the commands from package.json but not being able to find the code to call behind the methods behind it. Is there something I can test to check these in more details?

@jeffyoung
Copy link
Contributor

jeffyoung commented Jun 5, 2017

Hi @BrianFarnhill.

Do other folks in your organization have the extension working properly? Using TFVC? If so, are there any known differences between the two set ups? Different OS?

I can say that I haven't tested with Windows 7 although I'll see if I can download an image and try it out.

I'm quite surprised that the log file never gets written to since there's code to do just that almost immediately after creating the file. While I'm setting up a Win7 environment, you may want to try running procmon.exe (at https://live.sysinternals.com/), filtering on the vscode process and a file path of team-extension.log to see if there are issues accessing it. That is, if the restrictions you're under allow you to do so.

Finally, have a look at the "C:\Users\username\.vscode\extensions" folder on your computer (this is where VS Code installs extensions). Verify that the folder for the extension looks something like this (it'll help rule out some sort of installation issue). I don't expect this to be an issue but want to be sure.

image

@jeffyoung
Copy link
Contributor

OK. So I stood up a VM with Windows 7 SP1, downloaded and installed .NET 4.6.2, and installed VS Team Explorer 2017. I went ahead and installed VS Code and the extension. I also got the Git tools for Windows and cloned a repo from Team Services.

When I opened the Git repo folder, everything showed up as expected. I was first prompted for credentials (the PAT) and after giving a valid one, the status bar showed up with the proper data. I then created a local TFVC workspace (from a local TFS server), set up tfvc.location and opened that folder. I got prompted for my domain credentials, entered them and the status bar showed up with the proper data.

I'll await your response to my last one and any additional information you may have. If you happen to have a Git repository (TFS or Team Services), it would also be interesting to know if the extension works for that. It'll help me determine if it's the extension itself or something TFVC-specific.

@BrianFarnhill
Copy link
Author

@jeffyoung No worries - I'm away from the customer site where I was having this issue for a couple of days but I'll get back there as soon as I can and work through this to do list for you.

@BrianFarnhill
Copy link
Author

OK so I've gone and opened a git repo and tried the sign-in thing, and I still get the same error but I do see some detail hitting the log file for the git-repo. it all looks pretty standard save for one error that occurs in there a few times saying "spawn UNKNOWN"

I've verified that the directory for the extension exists there as well with all the right files so the installation appears to have gone fine.

I busted out procmon and figured out there was an access denied thing happening with the log file for that workspace (it was saved to a location that backed out to a network location behind the scenes). I swapped it out for something hitting the local disk to resolve that and I started seeing some things light up in the log file for that workspace now. I've done some find/replace work to remove customer specific data from it, but here is the output I see:

2017-06-08T22:48:27.131Z - info: [05544] *** FOLDER: z:\repos\MyWorkspace ***
2017-06-08T22:48:27.133Z - info: [05544] VSTSVSCode/1.118.2 (VSCode 1.12.2; Windows_NT 6.1.7601; Node 7.4.0)
2017-06-08T22:48:27.133Z - debug: [05544] Looking for an External Context at z:\repos\MyWorkspace
2017-06-08T22:48:27.133Z - debug: [05544] No External Context at z:\repos\MyWorkspace
2017-06-08T22:48:27.135Z - debug: [05544] Looking for TFVC repository at z:\repos\MyWorkspace
2017-06-08T22:48:27.135Z - debug: [05544] TFVC Creating Tfvc object with localPath='undefined'
2017-06-08T22:48:27.136Z - debug: [05544] Using TFS proxy: undefined
2017-06-08T22:48:27.136Z - debug: [05544] TFVC Retrieved from settings; localPath='C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe'
2017-06-08T22:48:27.136Z - debug: [05544] TFVC Repository created with repositoryRootFolder='z:\repos\MyWorkspace'
2017-06-08T22:48:27.136Z - debug: [05544] TFVC Repository.CheckVersion
2017-06-08T22:48:27.137Z - debug: [05544] TFVC: tf add -noprompt -?
2017-06-08T22:48:27.140Z - debug: [05544] TFVC: spawned new process (duration: 2ms)
2017-06-08T22:48:27.145Z - debug: [05544] TFVC: spawned new process (duration: 4ms)
2017-06-08T22:48:27.500Z - debug: [05544] TFVC: add exit code: 0 (duration: 362ms)
2017-06-08T22:48:27.502Z - debug: [05544] TFVC Minimum required version: 14.102.0
2017-06-08T22:48:27.502Z - debug: [05544] TFVC (TF.exe, TF.cmd) version: 15.112.26410.0
2017-06-08T22:48:27.502Z - debug: [05544] TFVC Repository.FindWorkspace with localPath='z:\repos\MyWorkspace'
2017-06-08T22:48:27.503Z - debug: [05544] TFVC: tf workfold -noprompt ********
2017-06-08T22:48:27.505Z - debug: [05544] TFVC: spawned new process (duration: 2ms)
2017-06-08T22:48:27.925Z - debug: [05544] TFVC: workfold exit code: 0 (duration: 422ms)
2017-06-08T22:48:27.927Z - debug: [05544] Found a TFVC repository for url: 'http://MyTfsServer/tfs/MyCollection' and team project: 'MyWorkspace'.
2017-06-08T22:48:27.929Z - debug: [05544] Parsing values from repositoryInfo as string url
2017-06-08T22:48:27.929Z - debug: [05544] TFVC Creating Tfvc object with localPath='undefined'
2017-06-08T22:48:27.929Z - debug: [05544] Using TFS proxy: undefined
2017-06-08T22:48:27.929Z - debug: [05544] TFVC Retrieved from settings; localPath='C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe'
2017-06-08T22:48:27.929Z - debug: [05544] TFVC Repository created with repositoryRootFolder='z:\repos\MyWorkspace'
2017-06-08T22:48:27.931Z - error: [05544] spawn UNKNOWN

Now the only other thing worth knowing there is that you can see the repository is showing up as Z:\ in this example. This is because the customer actually doesn't allow direct access to the C:\ in this case (but it's really only blocked through windows explorer, you can bust open powershell or a cmd.exe prompt and browse files and directories there). The Z:\ in this example is nothing more than a mapped network drive to \localhost\C$\ to get around that specific limitation. It's worth noting that I can still run programs from the C:\ though (I called tf.exe from a command prompt just fine to create the workspace, and vscode runs from the C:\ just fine as well - its just an obscurity thing).

Let me know how you want me to progress the troubleshooting on this one next. Also happy for you to look me up on the internal GAL and ping me on skype or email if you wanna chat further.

@jeffyoung
Copy link
Contributor

Thanks @BrianFarnhill. I took a look at the logs and think I know what's going sideways.

On Windows, when we go to retrieve credentials, we use a file named 'creds.exe' to interact with the credential store. In that code, we aren't resolving any symlinks (we just do a path.join(__dirname, "..\bin\win32\creds.exe"). I've attached a private build that uses fs.realpathSync(path.join(__dirname, "..\bin\win32\creds.exe")) to see if it will resolve to the file we need to run. Since tf.exe can run successfully from C:, I'm presuming that VS Code is running from Z: and when our extension runs (also from Z:) we get a Z: path for creds.exe and it's failing (again, this is what I'm presuming). Here are some instructions on how to install that private build.

LMK the results (so I can determine if we need to do some more investigation). I'm hopeful this will resolve it. 😄

team-0.118.2.vsix.zip

@jeffyoung jeffyoung changed the title Error: command 'team.signin' not found Error: command 'team.signin' not found [mapped drive] Jun 9, 2017
@BrianFarnhill
Copy link
Author

Thanks @jeffyoung I'll let you know. I'm back out at that customer at the end of this month, so it'll be a couple of weeks before I get a chance to get back to you, but I'll definitely get it verified for you.

@jeffyoung
Copy link
Contributor

Great! Thanks @BrianFarnhill

@BrianFarnhill
Copy link
Author

OK so I've done some kicking around and it appears that when I'm trying to run commands from other extensions that I'm getting this same error as well (I had assumed that since I got my proper formatting and some of the functionality of the PowerShell extension that it was fine, but when I bring up the command window and type something there I get the same issue). So based on that I've come to the conclusion that the issue I have here is nothing related to you guys or your extension, but something to do with this environment for my customer and it impacting on all extensions. So I'll keep chasing that one and see where this takes me. I appreciate the effort in helping me get this far with it though @jeffyoung you've been great.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants