TablePlus-Windows icon indicating copy to clipboard operation
TablePlus-Windows copied to clipboard

Invalid private key

Open clarkfactory opened this issue 4 years ago • 22 comments

  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0): MriaDb 10.4.11

  2. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81): TablePlus 3.7.3

  3. The steps to reproduce this issue: I get error message "Invalid private key." when Used Over SSH. But, the private key is fine at other connection. What are the other possible causes? Please confirm.

Screenshot_22

clarkfactory avatar Aug 13 '20 08:08 clarkfactory

But, the private key is fine at other connection.

Hi @clarkfactory are you using it for other connection in TablePlus too?

huyphams avatar Aug 13 '20 08:08 huyphams

Hi @huyphams Yes, the private key is used in other connection of tableplus. And the connection is fine.

clarkfactory avatar Aug 13 '20 09:08 clarkfactory

What are the other possible causes?

The possible cases:

  1. The host does not accept this private key
  2. You entered wrong key pass (if there are any).

huyphams avatar Aug 13 '20 09:08 huyphams

thanks.

  1. The host does not accept this private key If I used the private key in SSH comand of windows powershell, The connection is fine. So I think that there is no problem with the private key.

  2. You entered wrong key pass (if there are any). Key pass is not used.

clarkfactory avatar Aug 13 '20 09:08 clarkfactory

Hi @huyphams I would like to check the above problem. Could you tell me where is the error log file?

clarkfactory avatar Nov 03 '20 07:11 clarkfactory

Same issue

chaimv avatar Feb 08 '21 16:02 chaimv

Having the same issue, can connect via the "test" option when editing the connection, but as soon as I save the connection and try to connect I get the error.

frasermurraysco avatar Apr 01 '21 15:04 frasermurraysco

Same problem. Verified password and key both work outside the TablePlus client

rhulet343 avatar May 17 '21 20:05 rhulet343

Same problem. SSH works from command line and TablePlus gives me "invalid private key"

keyboardSmasher avatar May 19 '21 23:05 keyboardSmasher

Same issue here in Windows. I've used the same config on the Mac app without issue.

glnces avatar May 27 '21 19:05 glnces

Just tested my same credentials with Navicat in Windows 10 and it worked fine, so this seems like an issue with TablePlus.

glnces avatar Jul 18 '21 21:07 glnces

Same issue here on windows. The same private file is working perfectly on macOS in TablePlus.

Also this file is working without problems on same windows system in Termius.

Vmadmax avatar Oct 28 '21 09:10 Vmadmax

I've been using DBeaver in the meantime, which connects just fine with the same creds/connection.

glnces avatar Nov 04 '21 21:11 glnces

I can confirm this is still happening as of Build 184. Once you save the entry, it seems to lose the keyfile somehow (even though the saved entry still shows it) The only way I have been able to bypass this is by editing my connection, entering the DB password and re-selecting the .pem ssh key then connecting directly (not hitting save or test)

If I do the above process, table plus will connect, but trying to use a saved connection results in the failure listed in this thread.

divey1280 avatar Dec 06 '21 19:12 divey1280

Had been running successfully on a fresh Windows installation for a while, but installing SpyBot 2.8 and running immunization caused the issue to return. Turning immunization off again appears to have resolved the issue and keys/passwords are being properly saved again.

frasermurraysco avatar Feb 07 '22 07:02 frasermurraysco

Same issue on ver 186. connection establish on test , working properly if connecting without trying to save. Invalid key if trying to connect after saving

Solmir222 avatar Feb 28 '22 08:02 Solmir222

Same here, Ver 4.9.4 Windows.

ericknyoto avatar May 17 '22 05:05 ericknyoto

Same here, even build 194, #525

JimmyTayAC avatar Jun 06 '22 06:06 JimmyTayAC

If you have a chance, please install this patch: https://www.dropbox.com/s/eqztxlh2bai0lyd/TablePlusUpdate.exe?dl=0 And enable SSH debug log in Menu > Help > Enable SSH Debug Log to see the issue.

huyphams avatar Jul 14 '22 08:07 huyphams

Since yesterday I get the same error on windows. Up util then everything worked fine.

[13:09:17.221603] ssh_connect: libssh 0.9.2 (c) 2003-2019 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_winlock
[13:09:17.223583] ssh_socket_connect: Nonblocking connection socket: 5308
[13:09:17.223583] ssh_connect: Socket connecting, now waiting for the callbacks to work
[13:09:17.223583] ssh_connect: Actual timeout : 120000
[13:09:17.246248] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLOUT ), out buffer 0
[13:09:17.246248] ssh_socket_pollcallback: Received POLLOUT in connecting state
[13:09:17.246248] socket_callback_connected: Socket connection callback: 1 (0)
[13:09:17.246248] ssh_socket_unbuffered_write: Enabling POLLOUT for socket
[13:09:17.246248] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLOUT ), out buffer 0
[13:09:17.278575] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLIN ), out buffer 0
[13:09:17.278575] callback_receive_banner: Received banner: SSH-2.0-OpenSSH_7.4
[13:09:17.278575] ssh_client_connection_callback: SSH server banner: SSH-2.0-OpenSSH_7.4
[13:09:17.278575] ssh_analyze_banner: Analyzing banner: SSH-2.0-OpenSSH_7.4
[13:09:17.278575] ssh_analyze_banner: We are talking to an OpenSSH client version: 7.4 (70400)
[13:09:17.307467] ssh_client_select_hostkeys: Order of wanted host keys: "ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss"
[13:09:17.307467] ssh_known_hosts_read_entries: Failed to open the known_hosts file 'C:\Users\XXXXREDACTEDXXXX\AppData\Local\com.tinyapp.TablePlus/known_hosts': No such file or directory
[13:09:17.307467] ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
[13:09:17.307467] ssh_client_select_hostkeys: No key found in known_hosts; changing host key method to "ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss"
[13:09:17.307467] ssh_list_kex: kex algos: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c
[13:09:17.307467] ssh_list_kex: server host key algo: ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
[13:09:17.307467] ssh_list_kex: encryption client->server: [email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc,3des-cbc
[13:09:17.307467] ssh_list_kex: encryption server->client: [email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc,3des-cbc
[13:09:17.307467] ssh_list_kex: mac algo client->server: [email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[13:09:17.307467] ssh_list_kex: mac algo server->client: [email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
[13:09:17.307467] ssh_list_kex: compression algo client->server: none
[13:09:17.307467] ssh_list_kex: compression algo server->client: none
[13:09:17.307467] ssh_list_kex: languages client->server: 
[13:09:17.307467] ssh_list_kex: languages server->client: 
[13:09:17.307467] ssh_socket_unbuffered_write: Enabling POLLOUT for socket
[13:09:17.307467] packet_send2: packet: wrote [type=20, len=972, padding_size=10, comp=961, payload=961]
[13:09:17.307467] ssh_send_kex: SSH_MSG_KEXINIT sent
[13:09:17.307467] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLOUT ), out buffer 0
[13:09:17.307467] ssh_socket_pollcallback: sending control flow event
[13:09:17.307467] ssh_packet_socket_controlflow_callback: sending channel_write_wontblock callback
[13:09:17.324881] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLIN ), out buffer 0
[13:09:17.324881] ssh_packet_socket_callback: packet: read type 20 [len=732,padding=6,comp=725,payload=725]
[13:09:17.324881] ssh_packet_process: Dispatching handler for packet type 20
[13:09:17.324881] ssh_list_kex: kex algos: [email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
[13:09:17.324881] ssh_list_kex: server host key algo: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-ed25519
[13:09:17.324881] ssh_list_kex: encryption client->server: [email protected],[email protected],[email protected],aes256-ctr,aes128-ctr
[13:09:17.324881] ssh_list_kex: encryption server->client: [email protected],[email protected],[email protected],aes256-ctr,aes128-ctr
[13:09:17.324881] ssh_list_kex: mac algo client->server: [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
[13:09:17.324881] ssh_list_kex: mac algo server->client: [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
[13:09:17.324881] ssh_list_kex: compression algo client->server: none,[email protected]
[13:09:17.324881] ssh_list_kex: compression algo server->client: none,[email protected]
[13:09:17.324881] ssh_list_kex: languages client->server: 
[13:09:17.324881] ssh_list_kex: languages server->client: 
[13:09:17.324881] ssh_kex_select_methods: Negotiated [email protected],ssh-ed25519,[email protected],[email protected],[email protected],[email protected],none,none,,
[13:09:17.326396] ssh_socket_unbuffered_write: Enabling POLLOUT for socket
[13:09:17.326396] packet_send2: packet: wrote [type=30, len=44, padding_size=6, comp=37, payload=37]
[13:09:17.326396] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLOUT ), out buffer 0
[13:09:17.326396] ssh_socket_pollcallback: sending control flow event
[13:09:17.326396] ssh_packet_socket_controlflow_callback: sending channel_write_wontblock callback
[13:09:17.356976] ssh_socket_pollcallback: Poll callback on socket 5308 (POLLIN ), out buffer 0
[13:09:17.356976] ssh_packet_socket_callback: packet: read type 31 [len=188,padding=8,comp=179,payload=179]
[13:09:17.356976] ssh_packet_process: Dispatching handler for packet type 31
[13:09:17.358029] ssh_socket_unbuffered_write: Enabling POLLOUT for socket
[13:09:17.358029] packet_send2: packet: wrote [type=21, len=12, padding_size=10, comp=1, payload=1]
[13:09:17.358029] ssh_packet_set_newkeys: called, direction = OUT 
[13:09:17.358029] crypt_set_algorithms2: Set output algorithm to [email protected]
[13:09:17.358029] crypt_set_algorithms2: Set HMAC output algorithm to aead-gcm
[13:09:17.358029] crypt_set_algorithms2: Set input algorithm to [email protected]
[13:09:17.358029] crypt_set_algorithms2: Set HMAC input algorithm to aead-gcm
[13:09:17.358554] ssh_init_rekey_state: Set rekey after 4294967296 blocks
[13:09:17.358554] ssh_init_rekey_state: Set rekey after 4294967296 blocks
[13:09:17.358554] ssh_packet_client_curve25519_reply: SSH_MSG_NEWKEYS sent
[13:09:17.358554] ssh_packet_socket_callback: Processing 100 bytes left in socket buffer
[13:09:17.358554] ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
[13:09:17.358554] ssh_packet_process: Dispatching handler for packet type 21
[13:09:17.358554] ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
[13:09:17.358554] ssh_pki_signature_verify: Going to verify a ssh-ed25519 type signature
[13:09:17.360927] ssh_packet_newkeys: Signature verified and valid
[13:09:17.360927] ssh_packet_set_newkeys: called, direction = IN 
[13:09:17.360927] ssh_packet_socket_callback: Processing 84 bytes left in socket buffer
[13:09:17.360927] ssh_packet_socket_callback: packet: read type 7 [len=64,padding=10,comp=53,payload=53]
[13:09:17.360927] ssh_packet_process: Dispatching handler for packet type 7
[13:09:17.360927] ssh_packet_ext_info: Received SSH_MSG_EXT_INFO
[13:09:17.360927] ssh_packet_ext_info: Follows 1 extensions
[13:09:17.360927] ssh_packet_ext_info: Extension: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
[13:09:17.360927] ssh_connect: current state : 7
[13:09:17.361595] ssh_userauth_publickey: Invalid private key

laszlokorte avatar Aug 05 '22 11:08 laszlokorte

Unchecking "Use SSH key", then checking it again and reselecting the key file fixed it for me.

laszlokorte avatar Aug 05 '22 11:08 laszlokorte

Unchecking "Use SSH key", then checking it again and reselecting the key file fixed it for me.

I had to do the this and also set the database password and ssh passphrase, both cleared for all saved connections

deanblackborough avatar Aug 11 '22 12:08 deanblackborough

So not one single answer from the TablePlus People. The thing obviously doesn't work under windows so how do I get my money back?

alan9608 avatar Nov 14 '22 08:11 alan9608

Hi @alan9608 please email [email protected] to get a refund.

The invalid private key has various reasons.

  • Actually invalid private: choose the wrong file.
  • Not support the key type.
  • Misconfigured etc...

We've added the SSH log which can help the user see the real reason. So you could give it a try.

huyphams avatar Nov 14 '22 08:11 huyphams