go-redis/redis · warning

redis: unexpected client info flags(%s)

Error message

redis: unexpected client info flags(%s)

What it means

Thrown by parseClientInfo (command.go:8015) while parsing the 'flags' field of a CLIENT INFO or CLIENT LIST reply. Each character in the flags string maps to a known client state code (S=slave, M=master, P=pubsub, x=multi, b=blocked, etc.). Encountering a character not present in the switch statement triggers this error, meaning the Redis server is reporting a client flag this go-redis version does not recognize.

Source

Thrown at command.go:8015

					info.Flags |= ClientTrackingBCAST
				case 'd':
					info.Flags |= ClientDirtyCAS
				case 'c':
					info.Flags |= ClientCloseAfterCommand
				case 'u':
					info.Flags |= ClientUnBlocked
				case 'A':
					info.Flags |= ClientCloseASAP
				case 'U':
					info.Flags |= ClientUnixSocket
				case 'r':
					info.Flags |= ClientReadOnly
				case 'e':
					info.Flags |= ClientNoEvict
				case 'T':
					info.Flags |= ClientNoTouch
				default:
					return nil, fmt.Errorf("redis: unexpected client info flags(%s)", string(val[i]))
				}
			}
		case "db":
			info.DB, err = strconv.Atoi(val)
		case "sub":
			info.Sub, err = strconv.Atoi(val)
		case "psub":
			info.PSub, err = strconv.Atoi(val)
		case "ssub":
			info.SSub, err = strconv.Atoi(val)
		case "multi":
			info.Multi, err = strconv.Atoi(val)
		case "watch":
			info.Watch, err = strconv.Atoi(val)
		case "qbuf":
			info.QueryBuf, err = strconv.Atoi(val)
		case "qbuf-free":
			info.QueryBufFree, err = strconv.Atoi(val)

View on GitHub (pinned to 36d97525cd)

Solutions

  1. Upgrade go-redis to the latest release, which may have added support for the new flag character in the switch at command.go:7979
  2. Read the error message to identify the unknown flag character, then check Redis release notes or the server source for newly added client flags
  3. File an issue or open a PR in go-redis to add the missing case to the parseClientInfo switch statement

Example fix

// before
info, err := rdb.ClientInfo(ctx).Result()
if err != nil { panic(err) }

// after - upgrade go-redis, or tolerate the unknown flag:
info, err := rdb.ClientInfo(ctx).Result()
if err != nil && strings.Contains(err.Error(), "unexpected client info flags") {
    log.Warnf("server uses an unknown client flag; upgrade go-redis: %v", err)
    // fall back to raw client info if needed
}
Defensive patterns

Strategy: try-catch

Try / catch

info, err := rdb.ClientInfo(ctx).Result()
if err != nil {
    if strings.Contains(err.Error(), "unexpected client info flags") {
        log.Warnf("unknown client flag from server; consider upgrading go-redis: %v", err)
    }
    return nil, err
}

Prevention

When it happens

Trigger: Calling ClientInfo, ClientList, or ClientListFilter which all invoke parseClientInfo, against a Redis server that emits an unrecognized single-character flag code in the 'flags=' field of the CLIENT reply.

Common situations: Running go-redis against a newer Redis minor/patch release that introduced a new client flag character; connecting to a Redis fork or managed proxy (e.g., Redis Enterprise, Valkey) that emits non-standard flag characters; using a Redis build with experimental flags enabled.

Related errors


AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06). Data as JSON: /data/errors/29a664c507e8f118.json. Report an issue: GitHub.