Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOAUTH Authentication required when use go-redis connect dragonfly #2462

Closed
ly269nva opened this issue Feb 27, 2023 · 2 comments
Closed

NOAUTH Authentication required when use go-redis connect dragonfly #2462

ly269nva opened this issue Feb 27, 2023 · 2 comments

Comments

@ly269nva
Copy link

i want use go-redis/v9 to connect dragonfly (redis_version:df-v0.15.0, a db like redis), but i go a err : NOAUTH Authentication required.
but it ok when i use go-redis/v9 to connect my local redis,
and it also ok when i use go-redis/v8 to connect dragonfly.
this is a bug? why go-redis/v9 not support dragonfly with password?
`
var redisdb *redis.Client

redisdb = redis.NewClient(&redis.Options{
Addr: "127.0.0.1:6379", // 指定
Password: "1234",
DB: 2, // redis一共16个库,指定其中一个库即可
PoolSize: 2000,
})

t.Log(redisdb.Info(context.Background()))
`

@monkey92t
Copy link
Collaborator

I don't know the dragonfly system, let me introduce the difference between go-redis v8 and v9:

v8:

if c.opt.Password != "" {
	if c.opt.Username != "" {
		pipe.AuthACL(ctx, c.opt.Username, c.opt.Password)
	} else {
		pipe.Auth(ctx, c.opt.Password)
	}
}

v9 first uses the HELLO username password command for authentication, and if it fails, then use the authentication method of the v8 version.

@monkey92t
Copy link
Collaborator

If there are no more questions, we close this issue.

xinzhanguo added a commit to xinzhanguo/go-redis that referenced this issue Mar 9, 2023
monkey92t added a commit that referenced this issue Mar 10, 2023
…"NOAUTH Authentication required" error (#2479)

* fixed #2462 error NOAUTH and support dragonfly

* check add comment

* alignment

---------

Co-authored-by: Monkey <golang@88.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants