[Database Source] SSH: Unable to find host/port in URL

Answered

 Hi! I'm trying to make use of IDEA/Datagrip's built in SSH Tunneling feature for database connectivity. As soon as I enable it, I get the warning: 


Attempting to connect, even after trying to create a template, results in:

2018-03-08 11:33:08,496 [139600121] WARN - lij.database.util.ErrorHandler -
com.intellij.execution.ExecutionException:
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:164)
at com.intellij.database.console.JdbcDriverManagerImpl.getDriver(JdbcDriverManagerImpl.java:128)
at com.intellij.database.dataSource.DatabaseConnectionEstablisher.lambda$establishConnection$1(DatabaseConnectionEstablisher.java:56)
at com.intellij.database.dataSource.AsyncUtil.lambda$null$4(AsyncUtil.java:49)
at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(AsyncUtil.java:127)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:495)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:133)
at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:127)
at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$5(AsyncUtil.java:49)
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:981)
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2124)
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:110)
at com.intellij.database.dataSource.DatabaseConnectionEstablisher.establishConnection(DatabaseConnectionEstablisher.java:53)
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.supplyAsync(DatabaseConnectionManager.java:381)
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.createInner(DatabaseConnectionManager.java:321)
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.lambda$sync$2(DatabaseConnectionManager.java:301)
at com.intellij.database.dataSource.AsyncUtil.withAsyncFriendly(AsyncUtil.java:158)
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.sync(DatabaseConnectionManager.java:298)
at com.intellij.database.dataSource.DatabaseConnectionManager$Builder.sync(DatabaseConnectionManager.java:112)
at com.intellij.database.dataSource.DataSourceSyncManager.lambda$static$1(DataSourceSyncManager.java:39)
at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor$1.perform(DataSourceSyncManager.java:242)
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.updateDatabaseInfo(DatabaseModelLoader.java:283)
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.run(DatabaseModelLoader.java:266)
at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor.performSync(DataSourceSyncManager.java:244)
at com.intellij.database.dataSource.AsyncUtil.lambda$null$6(AsyncUtil.java:55)
at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(AsyncUtil.java:127)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:133)
at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:127)
at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$7(AsyncUtil.java:55)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
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: Unable to find host/port in URL
at com.intellij.database.console.JdbcDriverManagerImpl.createTunnel(JdbcDriverManagerImpl.java:185)
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.a(RemoteProcessSupport.java:213)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:143)
... 39 more
Caused by: java.lang.UnsupportedOperationException: Unable to find host/port in URL
at com.intellij.database.dataSource.DataSourceSshTunnelConfiguration.createTunnel(DataSourceSshTunnelConfiguration.java:140)
at com.intellij.database.console.JdbcDriverManagerImpl.createTunnel(JdbcDriverManagerImpl.java:177)
... 44 more

 

 My ssh-agent is running and working. Host is configured in OpenSSH config. Trying built-in keypair settings makes no difference. Using an IP address makes no difference. I've had this problem before on Datagrip too. (2017.x)

I'm using:

IntelliJ IDEA 2017.3.4 (Ultimate Edition)
Build #IU-173.4548.28, built on January 30, 2018
Licensed to (redacted) / Mike Heyns
You have a perpetual fallback license for this version
Subscription is active until November 30, 2018
JRE: 1.8.0_152-b1119.3 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.5-1-ARCH
1
5 comments

Please check that you have correct URL templates in jdbc Driver settings and that you have specified the correct URL connection string to remote database (in General tab). See https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000034784/comments/360000029784 about URL templates configuration.

0
Avatar
Permanently deleted user

Hi Andrey, after much trial and error, the solution was to explicitly set the port numbers for all connections. Even though they use the default and aren't needed when no SSH tunnel is set up.

Thanks for your help!

2

Same error here 

1

In my case url had an extra space at the end

0

same error.

my way:

one of them success,the other error,it's because Connection type:

change it default and then success.

therse I use ssh 

0

Please sign in to leave a comment.