{"record":{"id":"645721ee04f6942b","repo":"redis/jedis","slug":"malformed-failed-over-push-content","errorCode":null,"errorMessage":"Malformed FAILED_OVER push: <content>","messagePattern":"Malformed FAILED_OVER push: <content>","errorType":"exception","errorClass":"MalformedMaintenanceEventException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/MaintenancePushCodec.java","lineNumber":104,"sourceCode":"  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) {\n    if (i >= c.size() || !(c.get(i) instanceof byte[])) {\n      throw new MalformedMaintenanceEventException(\n          \"MOVING target must be a host:port byte[] at index \" + i + \": \" + c);\n    }\n    try {\n      return HostAndPort.from(SafeEncoder.encode((byte[]) c.get(i)));\n    } catch (Exception e) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/MaintenancePushCodec.java#L86-L122","documentation":"MaintenancePushCodec.failedOver() validates FAILED_OVER pushes, expecting [FAILED_OVER, Long seq, byte[] shards]. A payload of the wrong shape or field types throws a malformed exception including the raw content.","triggerScenarios":"A FAILED_OVER push arrives with <3 elements, a non-Long seq, or a shards field that is not byte[] — after a Redis Enterprise failover completes.","commonSituations":"Version mismatch between jedis and the Redis Enterprise cluster emitting maintenance pushes; intermediaries mutating push payloads; corrupted RESP3 push streams under load.","solutions":["Upgrade jedis to match the server's maintenance push format.","Compare the error's logged content against the documented [FAILED_OVER, seq, shards] shape and file an issue if valid-looking.","Rule out proxies rewriting RESP push arrays by connecting directly.","Reconnect after the failover window; subsequent pushes should parse if versions match."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static boolean isValidFailedOver(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 FAILED_OVER push: {}\", e.getMessage());\n}","preventionTips":["Upgrade jedis to match the server's push schema","Verify pushes on a direct connection without intermediaries","Exercise failovers in staging before production","File issues with the raw content when valid server pushes fail to decode"],"tags":["redis","resp3","push","failover","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"}