dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
25.53k stars 932 forks source link

Datagrip support #1707

Closed glad2os closed 1 year ago

glad2os commented 1 year ago

Describe the bug Clicking in the DataGrip to see what's inside the hash tables printing ERR wrong number of arguments for 'hrandfield' command

java.sql.SQLException: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hrandfield' command at jdbc.client.impl.RedisClientBase.sqlWrap(RedisClientBase.java:80) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:27) at jdbc.RedisStatement.executeImpl(RedisStatement.java:37) at jdbc.RedisStatement.execute(RedisStatement.java:122) in RemoteStatementImpl.execute(RemoteStatementImpl.java:79) Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hrandfield' command at redis.clients.jedis.Protocol.processError(Protocol.java:96) at redis.clients.jedis.Protocol.process(Protocol.java:137) at redis.clients.jedis.Protocol.read(Protocol.java:192) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:316) at redis.clients.jedis.Connection.getOne(Connection.java:298) at redis.clients.jedis.Jedis.sendCommand(Jedis.java:9482) at jdbc.client.impl.standalone.RedisJedisClient.executeImpl(RedisJedisClient.java:42) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:34) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:24) at jdbc.RedisStatement.executeImpl(RedisStatement.java:37) at jdbc.RedisStatement.execute(RedisStatement.java:122) in RemoteStatementImpl.execute(RemoteStatementImpl.java:79) ... 3 more

To Reproduce Steps to reproduce the behavior:

const redisClient = redis.createClient(
    {
        url: 'redis://localhost:6379/',
    }
);

players.push({id: socket.id, mmr: mmr, username: username, type: type});
await redisClient.hSet(`Lobby:${lobbyID}`, "Players", JSON.stringify(players));

Expected behavior Using Redis image at the Datagrip (Jetbrains) I could see the data inside the hash tables. Probably due to protocol or something else using Dragonflydb, I can not see the data inside. All data has been proceeded correctly (not the problem of writing or reading)

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Reproducible Code Snippet

# Minimal code snippet to reproduce this bug

Additional context Add any other context about the problem here.

romange commented 1 year ago

duplicate of https://github.com/dragonflydb/dragonfly/issues/858

theyueli commented 1 year ago

hi @glad2os, could you try your use case again to see if we have resolved your particular case? Thanks!

glad2os commented 1 year ago

@theyueli @romange Hello! I have got ERR wrong number of arguments for 'hrandfield' command Details

[2023-09-08 16:29:54] Connected
0> SELECT 0
[2023-09-08 16:29:54] completed in 3 ms
0> HRANDFIELD GameWS:QCjo_J4ea8lHMhSsAAAD 501 WITHVALUES
[2023-09-08 16:29:54] ERR wrong number of arguments for 'hrandfield' command

Using

  dragonflydb:
    image: docker.dragonflydb.io/dragonflydb/dragonfly
    ulimits:
      memlock: -1
    ports:
      - "6379:6379"
    volumes:
      - dragonflydata:/data

DataGrip 2023.2

java.sql.SQLException: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hrandfield' command at jdbc.client.impl.RedisClientBase.sqlWrap(RedisClientBase.java:80) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:27) at jdbc.RedisStatement.executeImpl(RedisStatement.java:37) at jdbc.RedisStatement.execute(RedisStatement.java:122) in RemoteStatementImpl.execute(RemoteStatementImpl.java:79) Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hrandfield' command at redis.clients.jedis.Protocol.processError(Protocol.java:96) at redis.clients.jedis.Protocol.process(Protocol.java:137) at redis.clients.jedis.Protocol.read(Protocol.java:192) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:316) at redis.clients.jedis.Connection.getOne(Connection.java:298) at redis.clients.jedis.Jedis.sendCommand(Jedis.java:9482) at jdbc.client.impl.standalone.RedisJedisClient.executeImpl(RedisJedisClient.java:42) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:34) at jdbc.client.impl.RedisClientBase.execute(RedisClientBase.java:24) at jdbc.RedisStatement.executeImpl(RedisStatement.java:37) at jdbc.RedisStatement.execute(RedisStatement.java:122) in RemoteStatementImpl.execute(RemoteStatementImpl.java:79) ... 3 more

theyueli commented 1 year ago

hi @glad2os ,

sorry for the confusion, the docker image uses a released version. The change that supports HRANDFIELD has not been released, but is available in the upstream code repository.

@romange could we create a docker image of the upstream version? Or if @glad2os you can't wait, you could also build a local version using the latest source code...

theyueli commented 1 year ago

hello again @glad2os , this change should now be available in our latest release. Could you have another try to see if this works for you? Thanks!