IntelliJ: database connections: ExecutionException: SSH: Failed to load Identity File

Answered

first post here:

When trying to test connections or connect to a database in IntelliJ IDEA that's been working previously, now getting:

"com.intellij.execution.ExecutionException: SSH: Failed to load identity file"

Was working in 2018.3.1.

Updated to 2018.3.2 to fix a separate issue but now this won't work.

 

Anybody have any ideas or suggestions? Should I be creating a ticket in youtrack?

 

1
8 comments
Avatar
Permanently deleted user

I have same issue. MacOS 10.14.1, PHPStorm 2018.3.2

0

What is the private key format? Could be the https://youtrack.jetbrains.com/issue/PY-24325 Please try https://youtrack.jetbrains.com/issue/PY-24325#focus=streamItem-27-3169574-0-0 (using the OpenSSH Config and authentication agent authentication type option).

If issue remains, please provide Details output from Test Connection button for the Data Source. Please also add #com.intellij.ssh into Help | Debug Log Settings... restart IDE, reproduce the problem and attach idea.log after IDE restart and reproducing. Also please atatch screenshots of the connection settings (SSL/SSH tab).

0
Avatar
Permanently deleted user

Hi Andrey,

 

I also should've mentioned that I'm seeing this issue on MacOS 10.14.2

 

Type RSA and bits set to 4096.

here's the command I used to generate the keys: ssh-keygen -t rsa -b 4096 -C "my email"

 

By details I'm assuming the "view" button after it fails? all it says is:

"com.intellij.execution.ExecutionException: SSH: Failed to load identity file."

 

Here's some info from the debug log with some data redacted.


2019-01-02 10:44:26,819 [160295076]  DEBUG - ntellij.ssh.impl.SshConnection - No opened sessions to <username>@<company tunnel>:<port> found 

2019-01-02 10:44:26,819 [160295076]  DEBUG - ntellij.ssh.impl.SshConnection - Establishing new SSH session to <username>@<company tunnel>:<port>

2019-01-02 10:44:26,829 [160295086]   WARN - lij.database.util.ErrorHandler - com.intellij.execution.ExecutionException: SSH: Failed to load identity file 

java.lang.RuntimeException: com.intellij.execution.ExecutionException: SSH: Failed to load identity file

at com.intellij.util.ExceptionUtilRt.rethrow(ExceptionUtilRt.java:31)

at com.intellij.util.ExceptionUtilRt.rethrowAllAsUnchecked(ExceptionUtilRt.java:37)

at com.intellij.util.ExceptionUtil.rethrowAllAsUnchecked(ExceptionUtil.java:125)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.createInner(DatabaseConnectionManager.java:369)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.lambda$create$3(DatabaseConnectionManager.java:337)

at com.intellij.database.dataSource.AsyncUtil.withAsyncFriendly(AsyncUtil.java:161)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.create(DatabaseConnectionManager.java:335)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.access$100(DatabaseConnectionManager.java:287)

at com.intellij.database.dataSource.DatabaseConnectionManager$Builder.create(DatabaseConnectionManager.java:143)

at com.intellij.database.console.JdbcEngine.createConnection(JdbcEngine.java:160)

at com.intellij.database.console.JdbcEngine.lambda$new$0(JdbcEngine.java:129)

at com.intellij.database.console.JdbcEngine.getConnection(JdbcEngine.java:238)

at com.intellij.database.console.JdbcEngine.getConnection(JdbcEngine.java:188)

at com.intellij.database.console.JdbcEngine.lambda$visitRaw$8(JdbcEngine.java:477)

at com.intellij.database.console.AbstractEngine.lambda$submitRequest$4(AbstractEngine.java:182)

at com.intellij.database.console.AbstractEngine.lambda$null$2(AbstractEngine.java:156)

at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)

at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)

at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:136)

at com.intellij.database.console.AbstractEngine.lambda$submitRunnable$3(AbstractEngine.java:154)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.intellij.execution.ExecutionException: SSH: Failed to load identity file

at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:159)

at com.intellij.database.console.JdbcDriverManagerImpl.getDriver(JdbcDriverManagerImpl.java:129)

at com.intellij.database.dataSource.DatabaseConnectionEstablisher.lambda$establishConnection$1(DatabaseConnectionEstablisher.java:60)

at com.intellij.database.dataSource.AsyncUtil.lambda$null$4(AsyncUtil.java:52)

at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(AsyncUtil.java:130)

at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:539)

at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)

at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:136)

at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:130)

at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$5(AsyncUtil.java:52)

at com.intellij.database.dataSource.AsyncUtil.lambda$null$11(AsyncUtil.java:104)

at com.intellij.database.dataSource.AsyncUtil.lambda$static$2(AsyncUtil.java:36)

at com.intellij.database.dataSource.AsyncUtil.lambda$thenComposeAsync$12(AsyncUtil.java:104)

at com.intellij.database.dataSource.AsyncUtil.lambda$processWhenComplete$13(AsyncUtil.java:115)

at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760)

at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(CompletableFuture.java:778)

at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:2140)

at java.util.concurrent.CompletableFuture.whenComplete(CompletableFuture.java:110)

at com.intellij.database.dataSource.AsyncUtil.processWhenComplete(AsyncUtil.java:111)

at com.intellij.database.dataSource.AsyncUtil.thenComposeAsync(AsyncUtil.java:103)

at com.intellij.database.dataSource.DatabaseConnectionEstablisher.establishConnection(DatabaseConnectionEstablisher.java:57)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.supplyAsync(DatabaseConnectionManager.java:403)

at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.createInner(DatabaseConnectionManager.java:343)

... 22 more


Caused by: com.intellij.execution.ExecutionException: SSH: Failed to load identity file

at com.intellij.database.console.JdbcDriverManagerImpl.createTunnel(JdbcDriverManagerImpl.java:183)

at com.intellij.database.console.JdbcDriverManagerImpl.access$000(JdbcDriverManagerImpl.java:35)

at com.intellij.database.console.JdbcDriverManagerImpl$1.getRunProfileState(JdbcDriverManagerImpl.java:78)

at com.intellij.database.console.JdbcDriverManagerImpl$1.getRunProfileState(JdbcDriverManagerImpl.java:44)

at com.intellij.execution.rmi.RemoteProcessSupport.startProcess(RemoteProcessSupport.java:211)

at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:139)

... 44 more

Caused by: com.intellij.ssh.SshTransportException: Failed to load identity file

at com.intellij.ssh.SshConnectionUtil.a(SshConnectionUtil.kt:556)

at com.intellij.ssh.SshConnectionUtil.addIdentities(SshConnectionUtil.kt:538)

at com.intellij.ssh.SshConnectionUtil.setUpSession(SshConnectionUtil.kt:170)

at com.intellij.ssh.impl.SshConnection.b(SshConnection.kt:130)

at com.intellij.ssh.impl.SshConnection.a(SshConnection.kt:109)

at com.intellij.ssh.impl.SshConnection.getSshSession(SshConnection.kt:95)

at com.intellij.ssh.SshConnectionService.connect(SshConnectionService.kt:136)

at com.intellij.ssh.Ssh.a(ssh.kt:212)

at com.intellij.ssh.Ssh.access$connect(ssh.kt:1)

at com.intellij.ssh.ConnectionBuilder.connect(ssh.kt:89)

at com.intellij.database.dataSource.DataSourceSshTunnelConfiguration.createSshSession(DataSourceSshTunnelConfiguration.java:215)

at com.intellij.database.dataSource.DataSourceSshTunnelConfiguration.createTunnel(DataSourceSshTunnelConfiguration.java:145)

at com.intellij.database.console.JdbcDriverManagerImpl.createTunnel(JdbcDriverManagerImpl.java:178)

... 49 more

Caused by: com.jcraft.jsch.JSchException: invalid privatekey: <some data here. not sure if it's sensitive>

at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)

at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)

at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)

at com.jcraft.jsch.JSch.addIdentity(JSch.java:424)

at com.intellij.ssh.SshConnectionUtil.a(SshConnectionUtil.kt:553)

... 61 more



screenshot with data redacted, the private key file is just the default id_rsa file.

thanks.
0

Looks like the format is not supported. Please try this workaround as mentinoed. It should help.

0
Avatar
Permanently deleted user

Andrey,

 

Tried the workaround, not working. Giving me an "Error: SSH: Auth fail". Probably because our proxy host isn't configured to take ssh config and auth agent. Requires a username/password combination. Any other ideas to try?

 

thanks for your help.

0

Have you checked that it works from OS terminal? If it does not work from terminal this method will not work from IDE.

0
Avatar
Permanently deleted user

Figured it out. It was a missing key in one of our internal systems. 🤦‍♂️ Thanks again!

0
Avatar
Permanently deleted user

**Invalid**

```
-----BEGIN OPENSSH PRIVATE KEY-----
```


**Correct**

```
-----BEGIN RSA PRIVATE KEY-----
```

 

**Step to fix**

Remove old files

```
rm -rf ~/.ssh/*
```

Create new File (-m pem)

```
ssh-keygen -t rsa -b 2048 -m pem -f ~/.ssh/google_compute_engine -C username
```

1

Please sign in to leave a comment.