{"record":{"id":"104e2f76c1773647","repo":"apache/druid","slug":"cannot-convert-to-long-offset","errorCode":null,"errorMessage":"Cannot convert  to Long offset","messagePattern":"Cannot convert  to Long offset","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java","lineNumber":396,"sourceCode":"\n  @Override\n  protected String createPartitionIdFromString(String partitionIdString)\n  {\n    // RabbitMQ uses String as partition ID, so just return the string as-is\n    return partitionIdString;\n  }\n\n  @Override\n  protected Long createSequenceOffsetFromObject(Object offsetObj)\n  {\n    // RabbitMQ uses Long as sequence offset\n    if (offsetObj instanceof Number) {\n      return ((Number) offsetObj).longValue();\n    }\n    if (offsetObj instanceof String) {\n      return Long.parseLong((String) offsetObj);\n    }\n    throw new IllegalArgumentException(\"Cannot convert \" + offsetObj.getClass() + \" to Long offset\");\n  }\n\n  @Override\n  public LagStats computeLagStats()\n  {\n    Map<String, Long> partitionRecordLag = getPartitionRecordLag();\n    if (partitionRecordLag == null) {\n      return new LagStats(0, 0, 0);\n    }\n\n    return aggregatePartitionLags(partitionRecordLag);\n  }\n\n  @Override\n  public void updatePartitionLagFromStream()\n  {\n    getRecordSupplierLock().lock();\n","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java#L378-L414","documentation":"RabbitStreamSupervisor.createSequenceOffsetFromObject received a stored offset object that is neither a Number nor a numeric String, so it cannot be coerced to the Long sequence offset RabbitMQ streams use. This usually means persisted supervisor/segment metadata contains offsets written by a different supplier type or corrupted state.","triggerScenarios":"Thrown at extensions-contrib/rabbit-stream-indexing-service/src/main/java/org/apache/druid/indexing/rabbitstream/supervisor/RabbitStreamSupervisor.java:396 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log/examine the offending offsetObj type to identify where the bad value came from.","Check persisted supervisor metadata (offsets in metadata store) for corruption or mismatched supplier types.","If migrating from another stream supplier (e.g. Kafka), reset offsets or start fresh for the RabbitMQ stream.","Wrap Long.parseLong failures distinctly so numeric-string errors are reported separately from non-numeric types."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}