{"record":{"id":"b8d34d7802df2bf4","repo":"redis/jedis","slug":"maintenance-notifications-events-not-supported-on","errorCode":null,"errorMessage":"Maintenance notifications: events not supported on server","messagePattern":"Maintenance notifications: events not supported on server","errorType":"exception","errorClass":"JedisConnectionException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/MaintenanceAwareVisitor.java","lineNumber":102,"sourceCode":"      maintenanceEventListeners.add(controller);\n\n      // The server must accept CLIENT MAINT_NOTIFICATIONS ON. Pre-register the consumer so a\n      // push\n      // frame the server emits immediately on accepting the subscription cannot race ahead.\n      MaintenanceEventConsumer consumer = new MaintenanceEventConsumer(connection,\n          maintenanceEventListeners);\n      connection.addPushConsumer(consumer);\n\n      connection.sendCommand(Command.CLIENT, \"MAINT_NOTIFICATIONS\", \"ON\", \"moving-endpoint-type\",\n        resolveEndpointType(connection, mConfig));\n      try {\n        connection.getStatusCodeReply();\n        keepOverrides = true;\n      } catch (JedisDataException e) {\n        connection.removePushConsumer(consumer);\n\n        if (strict) {\n          throw new JedisConnectionException(\n              \"Maintenance notifications: events not supported on server\", e);\n        }\n        logger.debug(\n          \"Maintenance notifications disabled: server rejected CLIENT MAINT_NOTIFICATIONS ({}).\",\n          e.getMessage());\n      }\n    } finally {\n      if (!keepOverrides) {\n        // Undo the rebind overlay installed before the handshake — this connection does NOT support\n        // maintenance notifications.\n        ChainedTimeoutSource dts = connection.getTimeoutSource();\n        dts.removeOverride(dts.seekBy(controller));\n        dts.removeOverride(dts.seekBy(ExpiringTimeoutSource.class));\n      }\n    }\n  }\n\n  private static boolean isMaintenanceEnabled(MaintenanceNotificationsConfig maintenanceConfig) {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MaintenanceAwareVisitor.java#L84-L120","documentation":"Jedis enables server-side maintenance notifications (CLIENT MAINT_NOTIFICATIONS) after the handshake so the server can push MOVING/MIGRATED events. If the server rejects the registration with a JedisDataException and the visitor is in strict mode, Jedis rethrows it as a JedisConnectionException meaning the connected server does not support maintenance push events.","triggerScenarios":"Connecting with maintenance notifications enabled (strict mode) to a Redis server or proxy that does not implement CLIENT MAINT_NOTIFICATIONS; the server replies with an error to the registration command during visitAfterHandshake.","commonSituations":"Pointing a maintenance-aware client at an older Redis version, non-managed Redis, or a proxy that strips the MAINT_NOTIFICATIONS subcommand; forgetting to disable strict mode in test or on-prem environments.","solutions":["Set strict mode to false so unsupported servers degrade gracefully (events disabled, logged at debug)","Upgrade the Redis server to a version that supports CLIENT MAINT_NOTIFICATIONS (e.g. managed Redis with maintenance events)","If strict mode is required, target only endpoints known to support maintenance notifications"],"exampleFix":"// before\nMaintenanceAwareVisitor visitor = new MaintenanceAwareVisitor(/* strict */ true);\n// after\nMaintenanceAwareVisitor visitor = new MaintenanceAwareVisitor(/* strict */ false); // tolerate servers without maintenance events","handlingStrategy":"fallback","validationCode":"// Detect support before relying on events\ntry (Jedis j = new Jedis(host, port)) {\n  String reply = j.clientMaintenanceNotificationsOn(); // will throw if unsupported\n}","typeGuard":null,"tryCatchPattern":"try {\n  visitor.visitAfterHandshake(connection);\n} catch (JedisConnectionException e) {\n  if (e.getMessage().contains(\"events not supported\")) {\n    logger.warn(\"Server lacks maintenance events; continuing without them\");\n  } else {\n    throw e;\n  }\n}","preventionTips":["Run strict mode only against servers verified to support CLIENT MAINT_NOTIFICATIONS","Pin jedis and Redis server versions known to be compatible","Log at debug level when degrading so silent feature loss is visible in diagnostics"],"tags":["redis","handshake","maintenance-notifications","server-compatibility"],"backgroundTag":"feature-not-enabled","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}