Problems with Git SSH executable and ssh-ident
Answered
I'm currently using ssh-ident for ssh-agent handling and I have 'sshCommand = ssh-ident' set in my git config to force git to use this.
I am having problems in intellij where the git "Updating" process will never finish because it is forever waiting for a passphrase to unlock my key but intellij never prompts me for one.
Here is the log while using the "built-in" ssh client:
2017-09-22 09:38:06,020 [ 190139] INFO - git4idea.GitVcs - Git version: 2.14.1.0
2017-09-22 09:38:10,774 [ 194893] INFO - #git4idea.commands.GitHandler - git fetch took 155579 ms. Command parameters:
/usr/bin/git -c core.quotepath=false -c log.showSignature=false fetch origin --progress --prune
2017-09-22 09:38:10,774 [ 194893] INFO - #git4idea.commands.GitHandler - Enter passphrase for /home/chris/.ssh/id_rsa: Loading keys:
2017-09-22 09:38:10,774 [ 194893] INFO - #git4idea.commands.GitHandler - /home/chris/.ssh/id_rsa
2017-09-22 09:38:14,359 [ 198478] INFO - t4idea.update.GitUpdateProcess - update started|REBASE
2017-09-22 09:38:14,361 [ 198480] INFO - t4idea.update.GitUpdateProcess - checkRebaseInProgress: checking if there is an unfinished rebase process...
2017-09-22 09:38:14,361 [ 198480] INFO - t4idea.update.GitUpdateProcess - isMergeInProgress: checking if there is an unfinished merge process...
2017-09-22 09:38:14,361 [ 198480] INFO - t4idea.update.GitUpdateProcess - areUnmergedFiles: checking if there are unmerged files...
2017-09-22 09:38:14,367 [ 198486] INFO - idea.merge.GitConflictResolver - merge: no unmerged files
2017-09-22 09:38:14,368 [ 198487] INFO - t4idea.update.GitUpdateProcess - checking tracked branch configuration...
2017-09-22 09:38:14,374 [ 198493] INFO - #git4idea.update.GitFetcher - fetching /home/chris/org/git/services
2017-09-22 09:38:14,382 [ 198501] INFO - #git4idea.commands.GitHandler - [services] git -c core.quotepath=false -c log.showSignature=false fetch origin --progress --prune
2017-09-22 09:38:14,459 [ 198578] INFO - #git4idea.commands.GitHandler - /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
The same happens with "native" ssh client but the prompt for a passphrase does not appear in the logs.
Any help would be appreciated.
Please sign in to leave a comment.
Please check https://youtrack.jetbrains.com/issue/IDEA-54554 and the linked issues.
It most likely happens because ssh-agent is not started yet, and IDE cannot handle prompts. It is not a terminal, so Native is expected to fail.
In case of Built-in SSH client, IDEA uses GIT_SSH variable to tell git which SSH executable to use, and this allows IDE to use its own-generated wrapper and show you prompt. Seems that by the sshCommand = ssh-ident you actually override this, and IDE cannot show you a prompt because of this.
You need to have ssh-agent running, and it should be available from the IDE environment (e.g. IDE should be started from the same command line as the agent, or a similar setup).