DataGrip 2021.2.4 SSH Tunnelling no longer works
I'm getting following error when connecting to a DB via SSH tunnel:
[2021-11-09 11:26:54] SSH tunnel creation failed:.
[2021-11-09 11:26:54] com.intellij.execution.ExecutionException: SSH: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF.
the same DB connection was working couple of days ago.
I still can connect to that host under the same credentials via terminal and moreover SSH tunneling works in the DBeaver, but for some reason DataGrip still fails to connect.
I tried to change DataGrip runtime (now I'm using built one), delete ssh config (under ~/.ssh), change auth type with no result.
The whole stacktrace:
2021-11-09 11:31:56,962 [1076353] WARN - om.intellij.ssh.impl.sshj.sshj - Failed to connect. Brief info: SSH connection to eugenemaximovich@10.60.7.198:22
* With altered connection settings:
- authMethods: GssApi, PublicKey(privateKeys=[*****], agent=ALL), Password, KeyboardInteractive
- connectTimeout: PT10S
- hostKeyVerifier: OpenSSH-like host key verifier (knownHostsFile=[*], strictHostKeyChecking=ASK, hashKnownHosts=true)
- user: eugenemaximovich
* With auth agent ssh-agent[/run/user/1000/keyring/ssh]
* Failed to connect to * port 22
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:58)
2021-11-09 11:31:56,962 [1076353] WARN - unified.SshCredentialsEditorEx - net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
com.intellij.ssh.SshTransportException: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.setUpSessionForSshJ(SshjConnectionUtil.kt:211)
at com.intellij.ssh.impl.SshConnection.a(SshConnection.kt:256)
at com.intellij.ssh.impl.SshConnection.access$doSshjSshConnection(SshConnection.kt:31)
at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:249)
at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:31)
at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:406)
at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:388)
at com.intellij.ssh.impl.SshConnection.d(SshConnection.kt:246)
at com.intellij.ssh.impl.SshConnection.access$createSshSessionForSshj(SshConnection.kt:31)
at com.intellij.ssh.impl.SshConnection$checkCanAuthenticate$1.invoke(SshConnection.kt:154)
at com.intellij.ssh.impl.SshConnection$checkCanAuthenticate$1.invoke(SshConnection.kt:31)
at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:406)
at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:388)
at com.intellij.ssh.impl.SshConnection.checkCanAuthenticate(SshConnection.kt:133)
at com.intellij.ssh.SshConnectionService.checkCanAuthenticate(SshConnectionService.kt:188)
at com.intellij.ssh.Ssh.a(ssh.kt:266)
at com.intellij.ssh.Ssh.access$checkCanAuthenticate(ssh.kt:1)
at com.intellij.ssh.ConnectionBuilder.checkCanAuthenticate(ssh.kt:120)
at com.intellij.ssh.ui.unified.SshCredentialsEditorEx$1.a(SshCredentialsEditorEx.java:72)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:58)
Please sign in to leave a comment.
Yevhen Maksymovych,
Could you file and an issue in DataGrip bug tracker and attach IDE logs, out of
and if it possible SSH server logs (OpenSSH logs where SSH server is hosted)?
By the way, are you working with cyberark?
Still an issue with PhpStorm 2021.3.3
Orvils,
Could you provide more details or file an issue in DataGrip bug tracker?
vasily chernov
I have defined a regular SSH tunnel with username and host, authentication is via a key pair. Worked just fine two weeks ago, now I get the error when I try to use the remote DB.
I can connect to the ssh If I specify all the exact same parameters on the cli.
Error from the idea.log
I'd also add, that I manage to establish tunnel to the host via DBeaver (that uses JSch under the hood). But seems like sshj (used by DataGrip) doesn't support some specific SSH server configuration. (Unfortunately I'm not aware of server config, it's just provided me as is)
vasily chernov is there by any chance some hidden DataGrip property that allows changing ssh client?
Yevhen Maksymovych,
Try to update to the latest DataGrip 2022.1 . I hope, it should help with the issue
vasily chernov The issue is present also after the update to 2022.1
Still exists for me. I use a workaround
1. added new script under Preferences - External tools that executes following command ssh -N -L 5433:[databaseUrl]:5432 [username]@[jumphostIp]
2. changed url:port in the connection properties of that DB to localhost:5433
3. execute that script from Tools/External Tools menu before connecting to the DB
Now I can work with the DB from the DataGrip, but it still strange that internal OS ssh client can connect to the host while sshJ cannot.
And yes, I have that problem not with every ssh tunnel, only with specific ones. I have another DBs that use different tunnels, and they work properly, but some specific ones still getting that error
Yevhen Maksymovych, Orvils,
Could you file issues in DataGrip bug tracker describing your problems?
For me this worked:
1. Set the config credentials in ~/.ssh/config
2. Set PHPStorm to use OpenSSH config and authentication agent
https://youtrack.jetbrains.com/issue/IDEA-294346
This is a regression also in JetBrains Gateway Client 2022.x (it was fixed in 2021.something)