{"record":{"id":"8924618e3805509e","repo":"redis/jedis","slug":"malformed-migrating-push-content","errorCode":null,"errorMessage":"Malformed MIGRATING push: <content>","messagePattern":"Malformed MIGRATING push: <content>","errorType":"exception","errorClass":"MalformedMaintenanceEventException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/MaintenancePushCodec.java","lineNumber":81,"sourceCode":"  static MaintenanceEvent build(PushType type, PushMessage msg) {\n    return type.decoder.apply(msg.getContent());\n  }\n\n  private static MaintenanceEvent moving(List<Object> c) { // [MOVING, seq, time_s, host:port |\n                                                           // null]\n    if (c.size() < 4 || !(c.get(1) instanceof Long) || !(c.get(2) instanceof Long)) {\n      throw malformed(\"MOVING\", c);\n    }\n    // Explicit RESP3 null target => 'none' endpoint type (no remap). A byte[] target is parsed;\n    // anything else (wrong type, unparseable) is malformed.\n    HostAndPort target = c.get(3) == null ? null : parseHostPort(c, 3);\n    return new MovingEvent((Long) c.get(1), (Long) c.get(2), target);\n  }\n\n  private static MaintenanceEvent migrating(List<Object> c) { // [MIGRATING, seq, time_s, shards]\n    if (c.size() < 4 || !(c.get(1) instanceof Long) || !(c.get(2) instanceof Long)\n        || !(c.get(3) instanceof byte[])) {\n      throw malformed(\"MIGRATING\", c);\n    }\n    return new MigratingEvent((Long) c.get(1), (Long) c.get(2), shardIds(c, 3));\n  }\n\n  private static MaintenanceEvent failingOver(List<Object> c) { // [FAILING_OVER, seq, time_s,\n                                                                // shards]\n    if (c.size() < 4 || !(c.get(1) instanceof Long) || !(c.get(2) instanceof Long)\n        || !(c.get(3) instanceof byte[])) {\n      throw malformed(\"FAILING_OVER\", c);\n    }\n    return new FailingOverEvent((Long) c.get(1), (Long) c.get(2), shardIds(c, 3));\n  }\n\n  private static MaintenanceEvent migrated(List<Object> c) { // [MIGRATED, seq, shards]\n    if (c.size() < 3 || !(c.get(1) instanceof Long) || !(c.get(2) instanceof byte[])) {\n      throw malformed(\"MIGRATED\", c);\n    }\n    return new MigratedEvent((Long) c.get(1), shardIds(c, 2));","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MaintenancePushCodec.java#L63-L99","documentation":"MaintenancePushCodec.migrating() validates MIGRATING push messages ( Redis Enterprise slot migration notifications): payload must be [MIGRATING, Long seq, Long time_s, byte[] shards]. Anything shorter or type-mismatched throws a malformed exception including the raw content.","triggerScenarios":"A MIGRATING push arrives with <4 elements, non-Long seq/time_s, or a shards field that is not a byte[] — typically a server/client schema mismatch or corrupted push stream.","commonSituations":"Redis Enterprise cluster performing slot migrations while client and server versions disagree on push format; proxies altering RESP arrays; mixed-version clusters during rolling upgrades.","solutions":["Align jedis version with the Redis Enterprise/Redis version emitting the pushes.","Capture the content in the error message and verify against the server's push spec; report a mismatch.","Test with a direct connection (no proxy) to rule out payload mutation.","Retry the connection after the maintenance window completes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static boolean isValidMigrating(List<Object> c) {\n  return c.size() >= 4 && c.get(1) instanceof Long && c.get(2) instanceof Long\n      && c.get(3) instanceof byte[];\n}","typeGuard":null,"tryCatchPattern":"try {\n  handle(codec.decode(push));\n} catch (JedisException e) {\n  log.warn(\"Dropping malformed MIGRATING push: {}\", e.getMessage());\n}","preventionTips":["Align jedis and Redis Enterprise versions","Verify push payloads over a direct (proxy-free) connection","Rolling-upgrade clusters in lockstep with client upgrades","Capture and report the logged raw content when it recurs"],"tags":["redis","resp3","push","migration","parsing"],"backgroundTag":"unexpected-api-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"}