miniredis icon indicating copy to clipboard operation
miniredis copied to clipboard

RESP3 Issues

Open oAnubis opened this issue 2 years ago • 11 comments

Possible User Error Sanity Check

If RESP3 is not activated automatically within NewMiniRedis() this is 100% user error and can be closed. Please inform me of how to activate if so.

If Not User Error

Steps To Reproduce

func Test_GetStuffAndThings(t *testing.T) {
     rdb := miniredis.NewMiniRedis()
     miniredis.Start()
     defer t.Cleanup

     FuncSeedDB()
 
     FuncDoStuff()  - This method runs a lua script using a go-redis client setup using "tcp" and rdb.Addr() 

}

Error Encountered

Within FuncCall() I am checking the lua returned interface for a nil value, if so returns "script returned empty handed" and the interface return, which indeed has no values. (I debugging and confirmed)

  • I am able to ping the server and receive a PONG response and no errors, so I ruled out the server not being open.
  • The lua scripts first call is redis.setresp(3)

I also manually checked to see if data available to pull, verified this is this case.

Additional Checks

I have verified my go functions and lua scripts are both functional against a local, VM, and cloud hosted databases, so it is not the code.

oAnubis avatar Jan 19 '23 20:01 oAnubis

Hi @oAnubis, thanks for your issue. I'll have a proper look soon, but IIRC you need to do a HELLO 3 command to enable RESP3 https://redis.io/commands/hello/

alicebob avatar Jan 19 '23 21:01 alicebob

Hi @oAnubis, thanks for your issue. I'll have a proper look soon, but IIRC you need to do a HELLO 3 command to enable RESP3 https://redis.io/commands/hello/

Thank you for the prompt reply.

I tried the HELLO 3 command, no changes in outcome.

I ran some more debugging and cross referencing the source code, I think this may a compatibility with the redis.setresp(3) command inside the lua script. This is where the errors traceback to.

oAnubis avatar Jan 19 '23 22:01 oAnubis

ok, do you maybe have a small reproducing test program?

alicebob avatar Jan 20 '23 07:01 alicebob

There's no setresp string in miniredis, so it looks like the function is simply not there. That would explain :)

alicebob avatar Jan 20 '23 15:01 alicebob

There's no setresp string in miniredis, so it looks like the function is simply not there. That would explain :)

That definitely makes sense! I wonder how difficult that would be to implement

oAnubis avatar Jan 20 '23 16:01 oAnubis

Additionally,

The error received back when running Hello 3 is can't parse "%7"

oAnubis avatar Jan 20 '23 17:01 oAnubis

Having the same issue after upgrading redis/go-redis to v9 (where they introduced RESP3)

hotrush avatar Mar 28 '23 15:03 hotrush

Got error after switch to rueidis error create rueidis unknown subcommand 'TRACKING'. Try CLIENT HELP.: ClientOption.DisableCache must be true for redis not supporting client-side caching or not supporting RESP3

Alexfilus avatar Feb 11 '24 18:02 Alexfilus

I forgot about this issue, will check soonish. Thanks!

alicebob avatar Feb 12 '24 08:02 alicebob