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

ERR Client sent AUTH, but no password is set #328

Open
LonelyBean opened this issue Feb 21, 2024 · 3 comments
Open

ERR Client sent AUTH, but no password is set #328

LonelyBean opened this issue Feb 21, 2024 · 3 comments

Comments

@LonelyBean
Copy link

redis版本6.2.14 申请集群的时候出现问题。

@githubname1024
Copy link
Collaborator

请提供部署任务的详细日志信息,以便分析。

@zergduan
Copy link

这是因为redis 的 protected-mode参数行为在高版本redis中变化导致的。

低版本redis时,protected-mode=yes是否生效决定于bind;但是高版本redis中,protected-mode=yes和bind无关。

cachecloud 在创建带密码的redis实例时,大概按照以下步骤完成:

  1. SSH到目标机器,创建redis配置文件(不带密码,即没有requirepass参数等)
  2. SSH到目标机器,使用上一步创建的配置文件启动redis实例
  3. 在cachecloud服务器上使用jedis远程连接上一步启动的redis实例
  4. 登陆实例后,使用config set 和config rewrite命令为实例设置default的密码

以上步骤,在低版本Redis中是没问题的,但是在高版本redis中就会出现问题,主要错误在第三步:在cachecloud服务器上使用jedis远程连接上一步启动的redis实例

因为第二步创建的redis实例,如果此时protected-mode的值为yes,第三步就会报错:无法连接redis实例,导致无法为redis实例设置密码。

然后后面的步骤中,会试图使用密码登陆redis实例,就会出现报错:c.sohu.cache.redis.impl.RedisCenterImpl : ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?

所以目前Cachecloud(3.2)是无法正常支持高本本Redis的创建的(例如Redis 7.0 , 7.2 或者 6.2的高版本)

但是也有临时方案,就是创建app时,因为无法登陆redis实例导致过程中断后,手动登陆实例config set protected-mode=no,然后重新执行被中断的创建过程,就可以完成正常创建了。

建议开发人员,修正这个问题,可以在创建conf文件时强制将protected-mode改为no,并在第四步添加密码时再将proteceted-mode改为yes。

@githubname1024
Copy link
Collaborator

首先说明一下:
在内网环境(部署redis的机器 与 部署CacheCloud机器),仅本地回环地址,不存在跨外部网络,是完全支持高版本Redis(6.2/7.0/7.2)部署的。

@zergduan 请提供一下部署网络环境的场景案例,以便在CacheCloud中兼容。

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

3 participants