{"record":{"id":"1972e05a0bb588cc","repo":"redis/node-redis","slug":"graceful-maintenance-is-only-supported-with-resp3","errorCode":null,"errorMessage":"Graceful Maintenance is only supported with RESP3","messagePattern":"Graceful Maintenance is only supported with RESP3","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/client/lib/client/index.ts","lineNumber":803,"sourceCode":"        }\n        return true\n      });\n    }\n  }\n\n  #validateOptions(options?: RedisClientOptions<M, F, S, RESP, TYPE_MAPPING>) {\n    const resp = options?.RESP ?? DEFAULT_RESP;\n    if (options?.clientSideCache && resp !== 3) {\n      throw new Error('Client Side Caching is only supported with RESP3');\n    }\n    if (options?.emitInvalidate && resp !== 3) {\n      throw new Error('emitInvalidate is only supported with RESP3');\n    }\n    if (options?.clientSideCache && options?.emitInvalidate) {\n      throw new Error('emitInvalidate is not supported (or necessary) when clientSideCache is enabled');\n    }\n    if (options?.maintNotifications && options?.maintNotifications !== 'disabled' && resp !== 3) {\n      throw new Error('Graceful Maintenance is only supported with RESP3');\n    }\n  }\n\n  #initiateOptions(options: RedisClientOptions<M, F, S, RESP, TYPE_MAPPING> = {}): RedisClientOptions<M, F, S, RESP, TYPE_MAPPING> {\n\n    // Convert username/password to credentialsProvider if no credentialsProvider is already in place\n    if (!options.credentialsProvider && (options.username || options.password)) {\n\n      options.credentialsProvider = {\n        type: 'async-credentials-provider',\n        credentials: async () => ({\n          username: options.username,\n          password: options.password\n        })\n      };\n    }\n\n    if (options.database) {","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/client/lib/client/index.ts#L785-L821","documentation":"maintNotifications uses RESP3 push messages for graceful maintenance (server-side disconnect hints). The literal value 'disabled' is exempt (it explicitly opts out). Any other value requires RESP3, and #validateOptions rejects it otherwise.","triggerScenarios":"createClient({ maintNotifications: 'graceful', RESP: 2 }) or any non-'disabled' maintNotifications value with the resolved RESP below 3.","commonSituations":"Forcing RESP: 2 for compatibility while still wanting maintenance mode; older redis server; misreading 'disabled' as the default.","solutions":["Set RESP: 3 (server must support graceful maintenance).","Or set maintNotifications: 'disabled' to explicitly opt out.","Or omit the option entirely if you do not need maintenance notifications."],"exampleFix":"// before\ncreateClient({ maintNotifications: 'graceful' });\n\n// after\ncreateClient({ maintNotifications: 'graceful', RESP: 3 });","handlingStrategy":"validation","validationCode":"function validateMaintOptions(options) {\n  const resp = options?.RESP ?? 3;\n  if (options?.maintNotifications && options.maintNotifications !== 'disabled' && resp !== 3) {\n    throw new Error('maintNotifications (other than disabled) requires RESP: 3');\n  }\n  return options;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set RESP: 3 when enabling graceful maintenance notifications.","Use the literal 'disabled' to explicitly opt out without forcing RESP3.","Validate maintenance option against RESP version at startup."],"tags":["config","resp3","maintenance","validation"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}