{"record":{"id":"a1781b603033b9f4","repo":"provectus/kafka-ui","slug":"wrong-seekto-argument-format-see-api-docs-for-det","errorCode":null,"errorMessage":"Wrong seekTo argument format. See API docs for details","messagePattern":"Wrong seekTo argument format\\. See API docs for details","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java","lineNumber":166,"sourceCode":"  }\n\n  /**\n   * The format is [partition]::[offset] for specifying offsets\n   * or [partition]::[timestamp in millis] for specifying timestamps.\n   */\n  @Nullable\n  private Map<TopicPartition, Long> parseSeekTo(String topic, SeekTypeDTO seekType, List<String> seekTo) {\n    if (seekTo == null || seekTo.isEmpty()) {\n      if (seekType == SeekTypeDTO.LATEST || seekType == SeekTypeDTO.BEGINNING) {\n        return null;\n      }\n      throw new ValidationException(\"seekTo should be set if seekType is \" + seekType);\n    }\n    return seekTo.stream()\n        .map(p -> {\n          String[] split = p.split(\"::\");\n          if (split.length != 2) {\n            throw new IllegalArgumentException(\n                \"Wrong seekTo argument format. See API docs for details\");\n          }\n\n          return Pair.of(\n              new TopicPartition(topic, Integer.parseInt(split[0])),\n              Long.parseLong(split[1])\n          );\n        })\n        .collect(toMap(Pair::getKey, Pair::getValue));\n  }\n\n  @Override\n  public Mono<ResponseEntity<TopicSerdeSuggestionDTO>> getSerdes(String clusterName,\n                                                                 String topicName,\n                                                                 SerdeUsageDTO use,\n                                                                 ServerWebExchange exchange) {\n    var context = AccessContext.builder()\n        .cluster(clusterName)","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/MessagesController.java#L148-L184","documentation":"Thrown by the generic validation guard at the head of MessagesController.parseSeekTo when a non-null, non-empty seekTo list contains an element whose format cannot be split into the expected '[partition]::[offset]' or '[partition]::[timestamp in millis]' shape. The offending input is one of the seekTo strings passed alongside seekType=OFFSET or TIMESTAMP; the error fires during streaming when splitting the element does not yield a parseable partition/offset pair, and the API caller must correct the seekTo element format.","triggerScenarios":"Passing seekTo values without the '::' separator, e.g. `0-42`, `0`, or full URLs/JSON fragments instead of `partition::value`.","commonSituations":"Manual query construction missing the double-colon; encoding issues where '::' got mangled; copying values from other tools that use a different separator.","solutions":["Format every seekTo item as `<partition>::<offset or timestampMillis>`, e.g. `0::42`","Check URL encoding — '::' is valid in query strings, don't double-encode it","Validate the list client-side before sending the request"],"exampleFix":"// before\nseekTo=0:42\n// after\nseekTo=0::42","handlingStrategy":"validation","validationCode":"function validateSeekTo(entries) {\n  return entries.every(e => /^[0-9]+::[0-9]+$/.test(e));\n}\nif (!validateSeekTo(seekTo)) throw new Error('seekTo entries must be partition::value');","typeGuard":"const isValidSeekTo = (v) => typeof v === 'string' && /^[0-9]+::[0-9]+$/.test(v);","tryCatchPattern":"try {\n  const res = await api.getMessages({ seekTo });\n} catch (e) {\n  if (e.status === 400 && /Wrong seekTo/.test(e.message)) {\n    seekTo = seekTo.map(normalizeToPartitionValueFormat);\n  }\n}","preventionTips":["Build seekTo strings programmatically: `${partition}::${offset}`","Never hand-assemble the value from user input without a regex check","Consult the OpenAPI docs for the exact format"],"tags":["rest-api","validation","query-parameter","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}