{"record":{"id":"7904f39f58954deb","repo":"apache/druid","slug":"use-interval-with-not-s-given","errorCode":null,"errorMessage":"Use interval with '/', not '_': [%s] given","messagePattern":"Use interval with '/', not '_': \\[(.+?)\\] given","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java","lineNumber":342,"sourceCode":"    } else {\n      RemoteSegmentUpdateOperation remoteOperation\n          = () -> overlordClient.markSegmentsAsUnused(dataSourceName);\n      return updateSegmentsViaOverlord(dataSourceName, remoteOperation);\n    }\n  }\n\n  @DELETE\n  @Path(\"/{dataSourceName}/intervals/{interval}\")\n  @ResourceFilters(DatasourceResourceFilter.class)\n  @Produces(MediaType.APPLICATION_JSON)\n  public Response killUnusedSegmentsInInterval(\n      @PathParam(\"dataSourceName\") final String dataSourceName,\n      @PathParam(\"interval\") final String interval,\n      @Context final HttpServletRequest req\n  )\n  {\n    if (StringUtils.contains(interval, '_')) {\n      log.warn(\"Use interval with '/', not '_': [%s] given\", interval);\n    }\n    final Interval theInterval = Intervals.of(interval.replace('_', '/'));\n    try {\n      final String killTaskId = FutureUtils.getUnchecked(\n          overlordClient.runKillTask(\"api-issued\", dataSourceName, theInterval, null, null, null),\n          true\n      );\n      auditManager.doAudit(\n          AuditEntry.builder()\n                    .key(dataSourceName)\n                    .type(\"segment.kill\")\n                    .payload(ImmutableMap.of(\"killTaskId\", killTaskId, \"interval\", theInterval))\n                    .auditInfo(AuthorizationUtils.buildAuditInfo(req))\n                    .request(AuthorizationUtils.buildRequestInfo(\"coordinator\", req))\n                    .build()\n      );\n      return Response.ok().build();\n    }","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java#L324-L360","documentation":"The kill/mark-unused interval endpoint warns when the interval path parameter uses '_' as the date separator (e.g. 2020-01-01_2020-02-01) instead of '/'. The API still works because the '_' is replaced with '/', but this legacy format is deprecated and should be updated in callers.","triggerScenarios":"POST/DELETE to /druid/coordinator/v1/datasources/{dataSourceName}/markUnused (or kill) with an interval string containing '_', e.g. markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval with interval '2019-01-01_2019-06-01'.","commonSituations":"Older scripts or tooling written against deprecated Druid interval URL syntax; interval strings copy-pasted from older documentation or cron jobs.","solutions":["Replace '_' with '/' in the interval portion of the URL","Escape the slash in the path if the HTTP client requires it, or pass the interval in the request body (kill task spec) instead of the URL","Update automation/scripts that still use the underscore interval syntax"],"exampleFix":"// before\nPOST /druid/coordinator/v1/datasources/wikipedia/markUnused?interval=2020-01-01_2020-02-01\n// after\nPOST /druid/coordinator/v1/datasources/wikipedia/markUnused?interval=2020-01-01/2020-02-01","handlingStrategy":"validation","validationCode":"if (interval.contains(\"_\")) { interval = interval.replace('_', '/'); } // or reject: throw new IllegalArgumentException(\"use '/' interval format\");","typeGuard":"boolean usesUnderscoreInterval(String s) { return s != null && s.indexOf('_') >= 0; }","tryCatchPattern":"try { postKill(dsName, interval); } catch (BadRequestException e) { LOG.warn(\"Check interval format for {}: {}\", interval, e.getResponse().readEntity(String.class)); }","preventionTips":["Always build intervals with ISO dates joined by '/'","Update legacy cron jobs using '_' interval URLs","Prefer passing the interval in the kill-task request body over the URL path"],"tags":["http","rest-api","deprecated","interval"],"backgroundTag":"deprecated-api-usage","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"}