{"record":{"id":"8299f1f99e4e3776","repo":"redis/jedis","slug":"ignoring-malformed-maintenance-push","errorCode":null,"errorMessage":"Ignoring malformed maintenance push: {}","messagePattern":"Ignoring malformed maintenance push: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/java/redis/clients/jedis/MaintenanceEventConsumer.java","lineNumber":41,"sourceCode":"    this.connection = connection;\n    this.listeners = listeners;\n  }\n\n  @Override\n  public PushConsumerContext handle(PushConsumerContext context) {\n    PushMessage message = context.getMessage();\n    MaintenancePushCodec.PushType type = MaintenancePushCodec.PushType.resolve(message.getType());\n\n    // not a maintenance event\n    if (type == null) {\n      return context;\n    }\n\n    MaintenanceEvent event;\n    try {\n      event = MaintenancePushCodec.build(type, message);\n    } catch (MalformedMaintenanceEventException e) {\n      logger.warn(\"Ignoring malformed maintenance push: {}\", message.getContent(), e);\n      context.drop(); // recognized maintenance frame is consumed even when malformed\n      return context;\n    }\n\n    for (MaintenanceEventListener listener : listeners) {\n      event.accept(listener, connection);\n    }\n    context.drop();\n    return context;\n  }\n}\n","sourceCodeStart":23,"sourceCodeEnd":53,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MaintenanceEventConsumer.java#L23-L53","documentation":"MaintenanceEventConsumer.handle receives a RESP push frame it recognizes as a maintenance event and decodes it with MaintenancePushCodec. If the payload is malformed (MalformedMaintenanceEventException), the consumer logs this warning with the raw content, calls context.drop() so the frame is still consumed (not surfaced as an unexpected push), and skips listener notification. The connection keeps working; only that maintenance event is lost.","triggerScenarios":"Redis server (or an intermediary/proxy) emits a MOVING/MIGRATED/maintenance push whose payload doesn't match the expected codec format — e.g. unexpected field count, wrong types in the push message, or a proxy synthesizing its own push frames.","commonSituations":"Connecting through a proxy or managed Redis that alters or adds push messages the client codec doesn't understand; server version emitting a newer push format than this client version parses; corrupted/interleaved frames after a protocol desync.","solutions":["Check the logged content to see what frame shape the server actually sent.","Upgrade jedis to a version whose MaintenancePushCodec matches your Redis/managed-service push format.","If behind a proxy (e.g. cluster proxy, load balancer with push injection), either bypass it for this client or disable maintenance-push handling in the client.","Verify Redis server version compatibility with the client's maintenance events support.","If frames are corrupted repeatedly, check for a protocol desync (shared connection misuse) — validate that no code writes raw commands on this connection."],"exampleFix":"// before\n<dependency>\n  <groupId>redis.clients</groupId>\n  <artifactId>jedis</artifactId>\n  <version>6.0.0</version> <!-- codec older than server push format -->\n</dependency>\n// after\n<dependency>\n  <groupId>redis.clients</groupId>\n  <artifactId>jedis</artifactId>\n  <version>6.2.0</version> <!-- matches server's maintenance push format -->\n</dependency>","handlingStrategy":"try-catch","validationCode":"// at registration time\nif (!listeners.isEmpty() && !supportsMaintenancePushFormat(serverVersion)) {\n  log.warn(\"server push format may not match client codec; update jedis\");\n}","typeGuard":null,"tryCatchPattern":"try { event = MaintenancePushCodec.build(type, message); } catch (MalformedMaintenanceEventException e) { logger.warn(\"ignoring push: {}\", content, e); context.drop(); }","preventionTips":["Keep jedis version aligned with your Redis/managed-service version's push format","Bypass proxies that inject or rewrite RESP push frames for this client","Register MaintenanceEventListeners you actually support; treat warnings as format drift signals","Watch for repeated warnings from one connection — indicates protocol desync to investigate"],"tags":["redis","protocol","push-message","maintenance","parsing"],"backgroundTag":"unexpected-response-shape","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"}