{"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/bb5beb56578573910e2ee8f39681edc214c41398/packages/client/lib/client/index.ts#L785-L821","documentation":"#validateOptions rejects `maintNotifications` (when not 'disabled') unless RESP is 3. Graceful Maintenance (enterprise maintenance notifications) depends on RESP3 PUSH messages (e.g. SMIGRATED events) delivered by the server; RESP2 has no push channel for them, so enabling maintenance notifications on RESP2 would silently never fire. Setting maintNotifications to the literal 'disabled' opts out and is allowed with any RESP version.","triggerScenarios":"`createClient({ RESP: 2, maintNotifications: { /* options */ } })`; any non-'disabled' maintNotifications value combined with RESP:2.","commonSituations":"Forcing RESP2 for compatibility while wanting enterprise maintenance handling; a shared base config pinning RESP and a feature config enabling maintenance.","solutions":["Use RESP3 (the default) when enabling maintNotifications.","If RESP2 is mandatory and you do not need maintenance notifications, set `maintNotifications: 'disabled'` to opt out explicitly.","Upgrade to a Redis Enterprise / RESP3-capable server."],"exampleFix":"// before\ncreateClient({ RESP: 2, maintNotifications: { /* ... */ } });\n\n// after\ncreateClient({ maintNotifications: { /* ... */ } }); // RESP3 default","handlingStrategy":"validation","validationCode":"function makeClient(opts) {\n  if (opts.maintNotifications && opts.maintNotifications !== 'disabled' && (opts.RESP ?? 3) !== 3) {\n    throw new TypeError('Graceful Maintenance requires RESP3');\n  }\n  return createClient(opts);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use RESP3 (the default) when enabling maintNotifications.","Set maintNotifications: 'disabled' to explicitly opt out under RESP2.","Confirm the server is Redis Enterprise / RESP3-capable."],"tags":["config","resp3","maintenance","enterprise","validation"],"analyzedSha":"bb5beb56578573910e2ee8f39681edc214c41398","analyzedAt":"2026-08-03T19:09:15.686Z","schemaVersion":2}