PyCharm + Bitbucket: Could not read from remote repository

Answered

I'm having trouble interacting with Git using PyCharm Community 2016.3.2. Whatever git commands I try, I always get the same error message, 'Could not read from remote repository.', and the same lines in idea.log:

"""

2017-03-14 22:11:29,312 [ 166827] INFO - #git4idea.commands.GitHandler - Cloning into 'timeclock'...
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - java.io.IOException: Authentication failed:
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:298)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:172)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - Caused by: java.io.IOException: Publickey authentication failed.
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:262)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:443)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at org.jetbrains.git4idea.ssh.SSHMain.tryPublicKey(SSHMain.java:352)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:243)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - ... 2 more
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - Caused by: java.io.IOException: Invalid PEM structure, '-----BEGIN...' missing
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at com.trilead.ssh2.crypto.PEMDecoder.parsePEM(PEMDecoder.java:138)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at com.trilead.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:313)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:171)
2017-03-14 22:11:30,565 [ 168080] INFO - #git4idea.commands.GitHandler - ... 5 more
2017-03-14 22:11:30,581 [ 168096] INFO - #git4idea.commands.GitHandler - fatal: Could not read from remote repository.
2017-03-14 22:11:30,581 [ 168096] INFO - #git4idea.commands.GitHandler - Please make sure you have the correct access rights
2017-03-14 22:11:30,581 [ 168096] INFO - #git4idea.commands.GitHandler - and the repository exists.

"""

I have checked my SSH private key file, and it does start with '-----BEGIN', so I'm guessing PyCharm is looking in the wrong place for it. However, I can't figure out where PyCharm searches for the SSH private key, though.

 

Any tips, anyone?

0
3 comments
Avatar
Permanently deleted user

I just figured it out. I'm using PyCharm's built-in SSH, and it doesn't seem to be compatible with ed25519 private keys. When I tried to use a RSA private key, it worked perfectly.

If I try to use the native SSH implementation, I get the following lines in idea.log:

 

"""

2017-03-14 22:41:28,723 [ 615075] INFO - #git4idea.commands.GitHandler - Cloning into 'timeclock'...
2017-03-14 22:41:30,052 [ 616404] INFO - #git4idea.commands.GitHandler - Permission denied (publickey).
2017-03-14 22:41:30,067 [ 616419] INFO - #git4idea.commands.GitHandler - fatal: Could not read from remote repository.
2017-03-14 22:41:30,068 [ 616420] INFO - #git4idea.commands.GitHandler - Please make sure you have the correct access rights
2017-03-14 22:41:30,068 [ 616420] INFO - #git4idea.commands.GitHandler - and the repository exists.

"""

1

Please vote for https://youtrack.jetbrains.com/issue/WI-27934 about adding support for ed25519 OpenSSH key.

0
Avatar
Permanently deleted user

I have, Anna, thanks.

 

Any tips on getting PyCharm to work with the native SSH implementation and Ed25519 keys?

 

Cheers!

0

Please sign in to leave a comment.