stuXnet stuXnet - 1 year ago 672
Git Question

git with IntelliJ IDEA: Could not read from remote repository

Since a few weeks, I'm not able to pull or push from or to the remote repository. I thought it happend when upgrading to IntelliJ IDEA 14, but I can reproduce the problem with IDEA 13.1.5 as well.

The tooltip says
"Fetch failed
fatal: Could not read from remote repository."

and the exception in the Version Control tab reads

14:02:37.737: cd C:\dev\project
14:02:37.737: git -c core.quotepath=false fetch origin --progress --prune Padding in RSA public key!
at com.trilead.ssh2.signature.RSASHA1Verify.decodeSSHRSAPublicKey(
at com.trilead.ssh2.KnownHosts.addHostkey(
at com.trilead.ssh2.KnownHosts.initialize(
at com.trilead.ssh2.KnownHosts.initialize(
at com.trilead.ssh2.KnownHosts.addHostkeys(
at org.jetbrains.git4idea.ssh.SSHMain.configureKnownHosts(
at org.jetbrains.git4idea.ssh.SSHMain.start(
at org.jetbrains.git4idea.ssh.SSHMain.main(
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Using the built-in terminal of IntelliJ, executing
git -c core.quotepath=false fetch origin --progress --prune
, it works just as it should.

According to the stacktrace, there seems to be a problem with my
, so I deleted our git server from
, hoping IntelliJ would insert it again. But the problem still appears when updating via the UI, and there is no new entry written in
; thinking about some caching of the file, I restarted IntelliJ, without success.

When doing another
git fetch
from the terminal, now I'm getting asked if I want to permanently add the server. After that, it has been written to
again, but IntelliJ still won't let me update my project.

I haven't found anything about this behavior online, so I guess it's not a known bug with the new IntelliJ version. Nevertheless, I updated to 14.0.2, but the problem still exists.

IntelliJ is configured to use the built-in SSH executable.

Does anybody have a clue what could be the problem here?

Answer Source

IntelliJ's built-in SSH client seems to hash it's known_hosts, but the one I had had it's host names in clear text.

When I deleted the file and let IntelliJ create a new one, with only my (hashed) GitLab server and nothing else, it worked.

It's also not possible to mix it - keep some unhashed entries together with hashed entries for IntelliJ. So, you have to configure your other SSH clients to use hashed hosts.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download