Compatibility with more Elastic Search versions?

Answered

Is there a way to use datagrip with elasticsearch versions other than the JDBC drivers provided?

My work uses v7.17.6 but datagrip only has v7.17.10 support and I can't use other JDBC drivers without a license.

And get I get a version mismatch exception if I try to connect elasticsearch v7.17.6 with v.7.17.10 driver:

DBMS: Elasticsearch (ver. 7.17.10)

Case sensitivity: plain=exact, delimited=exact

Driver: Elasticsearch JDBC Driver (ver. 7.17, JDBC4.2)




Ping: 159 ms (keep-alive query results in error)




[bad_server] Server sent bad type [action_request_validation_exception]. Original type was [Validation Failed: 1: The [7.17.10] version of the [jdbc] client is not compatible with Elasticsearch version [7.17.6];]. [org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: The [7.17.10] version of the [jdbc] client is not compatible with Elasticsearch version [7.17.6];

at org.elasticsearch.action.ValidateActions.addValidationError(ValidateActions.java:15)

at org.elasticsearch.xpack.sql.action.AbstractSqlQueryRequest.validate(AbstractSqlQueryRequest.java:270)

at org.elasticsearch.xpack.sql.action.SqlQueryRequest.validate(SqlQueryRequest.java:131)

at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:145)

at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:82)

at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:95)

at org.elasticsearch.rest.action.RestCancellableNodeClient.doExecute(RestCancellableNodeClient.java:81)

at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:407)

at org.elasticsearch.xpack.sql.plugin.RestSqlQueryAction.lambda$prepareRequest$0(RestSqlQueryAction.java:56)

at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:109)

at org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$0(SecurityRestFilter.java:90)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.lambda$authenticateAndAttachToContext$2(SecondaryAuthenticator.java:84)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticate(SecondaryAuthenticator.java:94)

at org.elasticsearch.xpack.security.authc.support.SecondaryAuthenticator.authenticateAndAttachToContext(SecondaryAuthenticator.java:78)

at org.elasticsearch.xpack.security.rest.SecurityRestFilter.lambda$handleRequest$2(SecurityRestFilter.java:85)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.action.ActionListener$MappedActionListener.onResponse(ActionListener.java:101)

at org.elasticsearch.action.ActionListener$RunBeforeActionListener.onResponse(ActionListener.java:389)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.writeAuthToContext(AuthenticatorChain.java:376)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.finishAuthentication(AuthenticatorChain.java:352)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.maybeLookupRunAsUser(AuthenticatorChain.java:205)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$doAuthenticate$1(AuthenticatorChain.java:128)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:141)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$3(AuthenticatorChain.java:175)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$3(RealmsAuthenticator.java:219)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:31)

at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:141)

at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$0(RealmsAuthenticator.java:164)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.lambda$authenticateWithCache$1(CachingUsernamePasswordRealm.java:155)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.handleCachedAuthentication(CachingUsernamePasswordRealm.java:242)

at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.lambda$authenticateWithCache$2(CachingUsernamePasswordRealm.java:139)

at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:136)

at org.elasticsearch.common.util.concurrent.ListenableFuture.notifyListenerDirectly(ListenableFuture.java:113)

at org.elasticsearch.common.util.concurrent.ListenableFuture.addListener(ListenableFuture.java:55)

at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.authenticateWithCache(CachingUsernamePasswordRealm.java:134)

at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.authenticate(CachingUsernamePasswordRealm.java:105)

at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.lambda$consumeToken$2(RealmsAuthenticator.java:148)

at org.elasticsearch.xpack.core.common.IteratingActionListener.run(IteratingActionListener.java:117)

at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.consumeToken(RealmsAuthenticator.java:233)

at org.elasticsearch.xpack.security.authc.RealmsAuthenticator.authenticate(RealmsAuthenticator.java:84)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:171)

at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:165)

at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:165)

at org.elasticsearch.xpack.core.common.IteratingActionListener.onResponse(IteratingActionListener.java:135)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.lambda$getAuthenticatorConsumer$5(AuthenticatorChain.java:165)

at org.elasticsearch.xpack.core.common.IteratingActionListener.run(IteratingActionListener.java:117)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.doAuthenticate(AuthenticatorChain.java:143)

at org.elasticsearch.xpack.security.authc.AuthenticatorChain.authenticateAsync(AuthenticatorChain.java:104)

at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:149)

at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:127)

at org.elasticsearch.xpack.security.rest.SecurityRestFilter.handleRequest(SecurityRestFilter.java:79)

at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:327)

at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:393)

at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:245)

at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:382)

at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:461)

at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:357)

at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:35)

at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:19)

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:48)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)

at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)

at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)

at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:620)

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:583)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

at java.base/java.lang.Thread.run(Thread.java:833)

].
0
3 comments
Official comment

You can download JDBC for Elasticsearch from  their official download page https://www.elastic.co/downloads/jdbc-client

In your case it would be https://www.elastic.co/downloads/past-releases/jdbc-client-7-17-6 and then you need to add a custom jar to the driver

Hello,

Sorry, but there is no way to connect if driver is not supported.

0

Is it possible to connect to Elasticsearch 8.6.2 with downloaded jar file?

I downloaded x-pack-sql-jdbc-8.6.2.jar and try to connect with this driver, also add x-pack-sql-jdbc-8.6.2.pom.
And have an error
DBMS: Elasticsearch (ver. 7.17.10)
Case sensitivity: plain=exact, delimited=exact
Driver: Elasticsearch JDBC Driver (ver. 7.17, JDBC4.2)
Effective version: UNKNOWN (ver. 8.6)
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.elasticsearch.xpack.sql.jdbc.EsDriver.<clinit>(EsDriver.java:27)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:467)
    at com.intellij.database.remote.jdbc.impl.ReflectionHelper.classForName(ReflectionHelper.java:39)
    at com.intellij.database.remote.RemoteJdbcServer.entryPoint(RemoteJdbcServer.java:32)
    at com.intellij.database.remote.RemoteJdbcServer.main(RemoteJdbcServer.java:19)
Caused by: java.lang.IllegalArgumentException: Multiple Elasticsearch JDBC versions detected in the classpath; please use only one
jar:file:/home/bendatiy/.config/JetBrains/PhpStorm2024.1/jdbc-drivers/Elasticsearch/7.17.10/org/elasticsearch/plugin/x-pack-sql-jdbc/7.17.10/x-pack-sql-jdbc-7.17.10.jar
jar:file:/home/bendatiy/.config/JetBrains/PhpStorm2024.1/jdbc-drivers/Elasticsearch/8.6.2/org/elasticseasrch/plugin/x-pack-sql-jdbc/8.6.2/x-pack-sql-jdbc-8.13.2.jar

    at shadow.org.elasticsearch.xpack.sql.client.ClientVersion.<clinit>(ClientVersion.java:68)
    ... 6 more.

And when I tried to use newer version have an error
DBMS: Elasticsearch (ver. 8.6.2)
Case sensitivity: plain=exact, delimited=exact
Driver: Elasticsearch JDBC Driver (ver. 8.6, JDBC4.2)

Ping: 18 ms (keep-alive query results in error)

current license is non-compliant for [jdbc].


 

0

Please sign in to leave a comment.