{"record":{"id":"be20f067152e88b5","repo":"redis/jedis","slug":"malformed-migrated-push-content","errorCode":null,"errorMessage":"Malformed MIGRATED push: <content>","messagePattern":"Malformed MIGRATED push: <content>","errorType":"exception","errorClass":"MalformedMaintenanceEventException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/MaintenancePushCodec.java","lineNumber":97,"sourceCode":"    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));\n  }\n\n  private static MaintenanceEvent failedOver(List<Object> c) { // [FAILED_OVER, seq, shards]\n    if (c.size() < 3 || !(c.get(1) instanceof Long) || !(c.get(2) instanceof byte[])) {\n      throw malformed(\"FAILED_OVER\", c);\n    }\n    return new FailedOverEvent((Long) c.get(1), shardIds(c, 2));\n  }\n\n  /** Diagnostic shard-id list (stringified JSON array), logging only; required on the wire. */\n  private static String shardIds(List<Object> c, int i) {\n    return SafeEncoder.encode((byte[]) c.get(i));\n  }\n\n  /** MOVING target {@code host:port}; throws when the target is absent or unparseable. */\n  private static HostAndPort parseHostPort(List<Object> c, int i) {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MaintenancePushCodec.java#L79-L115","documentation":"MaintenancePushCodec.migrated() validates MIGRATED pushes, expecting [MIGRATED, Long seq, byte[] shards] (only 3 elements, no timestamp). If the shape or types differ, a malformed exception is thrown with the raw content so the unparseable payload can be diagnosed.","triggerScenarios":"A MIGRATED push with <3 elements, non-Long seq, or non-byte[] shards field arrives after a Redis Enterprise slot migration completes.","commonSituations":"Schema drift between client and server versions; proxies rewriting RESP arrays; corrupted or interleaved push frames on a shared connection.","solutions":["Upgrade/align jedis with the server's push schema version.","Use the logged content to compare against the expected [MIGRATED, seq, shards] shape and report mismatches.","Connect directly to the node to rule out intermediary mutation.","If transient, reconnect — the codec operates per-push, not on shared state."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static boolean isValidMigrated(List<Object> c) {\n  return c.size() >= 3 && c.get(1) instanceof Long && c.get(2) instanceof byte[];\n}","typeGuard":null,"tryCatchPattern":"try {\n  handle(codec.decode(push));\n} catch (JedisException e) {\n  log.warn(\"Dropping malformed MIGRATED push: {}\", e.getMessage());\n}","preventionTips":["Keep jedis and Redis Enterprise versions compatible","Inspect logged payload content against the documented schema","Bypass proxies during migration events when diagnosing","Upgrade the client before enabling maintenance-driven remapping"],"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"}