Redigo: Can't connect to redis 3.0 version redis with password, 3.2 version is ok, is it not compatible ?

Created on 29 Aug 2018  路  4Comments  路  Source: gomodule/redigo

I use newPool to init redis.Pool

var (
    Pool *redis.Pool
)

func newPool(server string) *redis.Pool {
    return &redis.Pool{
        MaxIdle:     3,
        IdleTimeout: 240 * time.Second,
        Dial: func() (redis.Conn, error) {
            redisPwd, _ := misc.AppConf.Get("redis_pwd")  // get password from config

            conn, err := redis.Dial("tcp", server, redis.DialPassword(redisPwd))
            if err != nil {
                return nil, err
            }
            return conn, nil
        },
        TestOnBorrow: func(c redis.Conn, t time.Time) error {
            _, err := c.Do("PING")
            return err
        },
    }
}

Try to connect redis DB

func TestRedis(t *testing.T) {
    InitRedis()

    redisConn := Pool.Get()

    keys, err := redis.Strings(redisConn.Do("kEYS", "*"))
    if err != nil {
        t.Fatal(err)
    }

    fmt.Printf("%v\n", keys)

    time.Sleep(time.Hour)
}

While connecting 3.0 version redis DB , it return error : ERR Client sent AUTH, but no password is set

Most helpful comment

no password is set

Did you set a password in the configuration file and is that configuration file used by the server?

All 4 comments

The error message describes the problem. Either skip sending the password or set a password in the server's config.

@garyburd I have the same problem. I've set the requirepass in redis.windows.conf and run redis.exe with that config. When I do the pool connection, it says: Redis set failed: ERR Client sent AUTH, but no password is set

no password is set

Did you set a password in the configuration file and is that configuration file used by the server?

no password is set

Did you set a password in the configuration file?

Sorry, my bad. I mixed up my two Redis servers. Everything works fine now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Serhioromano picture Serhioromano  路  7Comments

lukasmalkmus picture lukasmalkmus  路  18Comments

smotes picture smotes  路  18Comments

mika picture mika  路  5Comments

elimisteve picture elimisteve  路  7Comments