-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powershell hangs on startup #258
Comments
Possibly related to #103 |
I assume commenting out the posh-git import in your |
Actually I more surgically commented out the line
I was able to run |
So we have a problem in |
Running Start-SshAgent seems to just hang after executing. |
Can you tell where it's hanging? Are you able to run |
I'm unfamialr with ssh-agent but I am able to run
Keep in mind that I have Posh-Git still enabled but the |
I have experienced the same issue when I tried to install win32-openssh using Chocolatey yesterday. I am not sure though, was it the win32-openssh package issue or posh-git. I ended up uninstalling the package. |
Well posh-git will use whatever My initial guess is that you're running into PowerShell/Win32-OpenSSH#110 at Line 319 in 7210894
PowerShell/Win32-OpenSSH#35 is also related to ssh-agent, but does not seem related to this issue. |
Found it: PowerShell/Win32-OpenSSH#110 (comment) Until that can be fixed, we might want to add a warning here if the |
Latest Win32-OpenSSH release no longer includes |
Based on the release notes it looks like this is temporary. |
I get intermittent hangs when PowerShell is used in a post-build script with Visual Studio 2015 with PoSH installed. Appears related to the SSH_AUTH_SOCK.env file being locked. Is this related to this issue? |
Try spawning PowerShell with
Probably not? posh-git writes the That being said, does your build hang only occur on machines with Win32-OpenSSH installed? |
I'm currently the only dev with PoSH installed and yes I have Win32-OpenSSH, but the |
👍 |
There is a bug in V3 and V4 of PowerShell that you might be hitting. If you load psreadline and some other module that generates an error into $error (older versions of posh-git definitely did, I'm not sure about newer), then you would occasionally hit a hang. If this is the issue, you can check if PowerShell starts without a hang, immediately look at $error, if you have PSReadline and $error is not empty and you have V3/V4 PowerShell, this is likely the issue. The best fix is to avoid writing anything to $error, maybe requiring an update to posh-git. Another workaround is to call 'Get-Module -ListAvailable' in your profile - this can be slow, hence not really recommended. |
PowerShell/Win32-OpenSSH#110 (comment):
|
@dahlbyk It appears to still be happening as of win32-openssh v2016.05.15. Maybe the ssh-agent as windows service thing is in the next release. Either way, it's not really a posh-git problem. |
If anyone were so inclined, we could suppress using |
From @DarwinJS on Chocolatey Gallery:
Currently we default to whatever |
When Win32-OpenSSH is installed (and the user picked the option to install sshd), the ssh-agent is defined and started as a service. Unfortunately this means you have to get into system context to add keys - I do this with the scheduler and it can be seen in the code of the package. What about looking for a running process called ssh-agent and just stand down if it is running? Or better yet - pre-check if ssh-agent is running and which software on the system put it there? This would hopeful reveal the user's intent on which SSH they want to be primary on their system. You can look in win32-openssh to see code patterns for figuring out the path of (and therefore which software package owns) a running sshd or ssh-agent. Win32-OpenSSH package only installs or upgrades or starts/stops ssh-agent or sshd IF the instance running is from it's own folder structure. |
We try to do this already in |
OK - here are the official install instructions: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH I just realized my package is not compliant with them because they didn't previously specify the application folder - so I think I put the binaries in "C:\Program Files" under the same subfolder that is in the zip. Which is "OpenSSH-Win32" and "OpenSSH-Win64" respectively. I will work on aligning the folder name on the next package revision. |
Does Win32-OpenSSH actually work with git? I've never been able to make operations perform correctly and PowerShell/Win32-OpenSSH#247 suggests it's not just me. If it doesn't, I'd be inclined to say that we want to special case Win32-OpenSSH to avoid using it. Equally, if/when git and Win32-OpenSSH do play well together, will git actually use the Win32-OpenSSH ssh.exe if it's first in the path, or will it use its own? If it prefers to use its own, I feel like we should also prefer to use the one provided with git, since the whole point of posh-git is to work with git. |
Win32-openssh probably has a ways to go to take up git responsibilities - but even then, who would want to do all that reconfig? One challenge is that the ssh that comes with git is not actually used unless the individual sets the machine up to do so. So maybe win32-openssh should look for a running instance of either ssh-agent or sshd that is not it's own - and if found, requires a special switch to forcibly install either of these on a system with it already configured? It won't handle the reverse install order (win32-openssh installed first then git) - but it could be a good first step. Maybe the same with the path if it finds a reference to ssh on it? |
Is anyone using Win32-OpenSSH able to take #295 for a spin to make sure it works as expected for you? |
We are trying to avoid this but it is kind of a PITA. When we execute git.exe and it writes to stderr, we want to avoid users seeing that error text so we redirect - We have code now that checks the $Error.Count and removes new errors. That kind of breaks down if $Error has hit its maximum count. Is there a better way to A) prevent users from seeing stderr and B) not writing stderr to $Error when executing a native command? |
This should be resolved by #586 in an upcoming v0.8 release. |
I believe this is adequately addressed by posh-sshell |
Just recently I installed Win32-OpenSSH using the new chocolatey package and I noticed that after rebooting I'm no longer able to start up PowerShell due to it hanging indefinitely. Not sure if this issue is an issue more with posh-git or Win32-OpenSSH but I thought I'd open some discussion.
Here is a starting place.
PowerShell/Win32-OpenSSH#42
The text was updated successfully, but these errors were encountered: