{"id":"29a664c507e8f118","repo":"go-redis/redis","slug":"redis-unexpected-client-info-flags-s","errorCode":null,"errorMessage":"redis: unexpected client info flags(%s)","messagePattern":"redis: unexpected client info flags\\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"command.go","lineNumber":8015,"sourceCode":"\t\t\t\t\tinfo.Flags |= ClientTrackingBCAST\n\t\t\t\tcase 'd':\n\t\t\t\t\tinfo.Flags |= ClientDirtyCAS\n\t\t\t\tcase 'c':\n\t\t\t\t\tinfo.Flags |= ClientCloseAfterCommand\n\t\t\t\tcase 'u':\n\t\t\t\t\tinfo.Flags |= ClientUnBlocked\n\t\t\t\tcase 'A':\n\t\t\t\t\tinfo.Flags |= ClientCloseASAP\n\t\t\t\tcase 'U':\n\t\t\t\t\tinfo.Flags |= ClientUnixSocket\n\t\t\t\tcase 'r':\n\t\t\t\t\tinfo.Flags |= ClientReadOnly\n\t\t\t\tcase 'e':\n\t\t\t\t\tinfo.Flags |= ClientNoEvict\n\t\t\t\tcase 'T':\n\t\t\t\t\tinfo.Flags |= ClientNoTouch\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, fmt.Errorf(\"redis: unexpected client info flags(%s)\", string(val[i]))\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"db\":\n\t\t\tinfo.DB, err = strconv.Atoi(val)\n\t\tcase \"sub\":\n\t\t\tinfo.Sub, err = strconv.Atoi(val)\n\t\tcase \"psub\":\n\t\t\tinfo.PSub, err = strconv.Atoi(val)\n\t\tcase \"ssub\":\n\t\t\tinfo.SSub, err = strconv.Atoi(val)\n\t\tcase \"multi\":\n\t\t\tinfo.Multi, err = strconv.Atoi(val)\n\t\tcase \"watch\":\n\t\t\tinfo.Watch, err = strconv.Atoi(val)\n\t\tcase \"qbuf\":\n\t\t\tinfo.QueryBuf, err = strconv.Atoi(val)\n\t\tcase \"qbuf-free\":\n\t\t\tinfo.QueryBufFree, err = strconv.Atoi(val)","sourceCodeStart":7997,"sourceCodeEnd":8033,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/command.go#L7997-L8033","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade go-redis to the latest release, which may have added support for the new flag character in the switch at command.go:7979","Read the error message to identify the unknown flag character, then check Redis release notes or the server source for newly added client flags","File an issue or open a PR in go-redis to add the missing case to the parseClientInfo switch statement"],"exampleFix":"// before\ninfo, err := rdb.ClientInfo(ctx).Result()\nif err != nil { panic(err) }\n\n// after - upgrade go-redis, or tolerate the unknown flag:\ninfo, err := rdb.ClientInfo(ctx).Result()\nif err != nil && strings.Contains(err.Error(), \"unexpected client info flags\") {\n    log.Warnf(\"server uses an unknown client flag; upgrade go-redis: %v\", err)\n    // fall back to raw client info if needed\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"info, err := rdb.ClientInfo(ctx).Result()\nif err != nil {\n    if strings.Contains(err.Error(), \"unexpected client info flags\") {\n        log.Warnf(\"unknown client flag from server; consider upgrading go-redis: %v\", err)\n    }\n    return nil, err\n}","preventionTips":["Keep go-redis updated when upgrading Redis server versions so new flag characters are recognized","Watch go-redis release notes for additions to the parseClientInfo flag switch","Avoid building logic that depends on exact ClientInfo flag values if forward compatibility matters"],"tags":["client-info","flags","redis-version","parsing","forward-compat"],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}