redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.34k stars 150 forks source link

PASSWORD auth not working with dragonflydb #207

Closed 0xManjeet closed 1 year ago

0xManjeet commented 1 year ago

I tested with go-redis client and it's working, rueidis is giving this error: NOAUTH Authentication required.

client, err := rueidis.NewClient(rueidis.ClientOption{ InitAddress: []string{"0.0.0.0:6379"}, DisableCache: true, Password: "myredispassword", })

the same config works with go-redis client.

I'm using latest version of both rueidis and dragonflydb, the issue is reproducible with examples given in both packages.

rueian commented 1 year ago

Hi @0xManjeet,

It seems that dragonflydb doesn't support HELLO AUTH (https://redis.io/commands/hello/)

Current workaround would be adding AlwaysRESP2 options to rueidis.NewClient:

c, err := rueidis.NewClient(rueidis.ClientOption{
    InitAddress: []string{
        "0.0.0.0:6379",
    },
    Password:     "myredispassword",
    DisableCache: true,
    AlwaysRESP2:  true,
})
0xManjeet commented 1 year ago

Thanks, it worked :)