apache/druid · info

Use interval with '/', not '_

Error message

Use interval with '/', not '_': [%s] given

What it means

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.

Solutions

  1. Replace '_' with '/' in the interval portion of the URL
  2. 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
  3. Update automation/scripts that still use the underscore interval syntax

Example fix

// before
POST /druid/coordinator/v1/datasources/wikipedia/markUnused?interval=2020-01-01_2020-02-01
// after
POST /druid/coordinator/v1/datasources/wikipedia/markUnused?interval=2020-01-01/2020-02-01
Defensive patterns

Strategy: validation

Validate before calling

if (interval.contains("_")) { interval = interval.replace('_', '/'); } // or reject: throw new IllegalArgumentException("use '/' interval format");

Type guard

boolean usesUnderscoreInterval(String s) { return s != null && s.indexOf('_') >= 0; }

Try / catch

try { postKill(dsName, interval); } catch (BadRequestException e) { LOG.warn("Check interval format for {}: {}", interval, e.getResponse().readEntity(String.class)); }

Prevention

When it happens

Trigger: 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'.

Common situations: Older scripts or tooling written against deprecated Druid interval URL syntax; interval strings copy-pasted from older documentation or cron jobs.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/7904f39f58954deb. Report an issue: GitHub.

Appendix: source

Thrown at server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:342

    } else {
      RemoteSegmentUpdateOperation remoteOperation
          = () -> overlordClient.markSegmentsAsUnused(dataSourceName);
      return updateSegmentsViaOverlord(dataSourceName, remoteOperation);
    }
  }

  @DELETE
  @Path("/{dataSourceName}/intervals/{interval}")
  @ResourceFilters(DatasourceResourceFilter.class)
  @Produces(MediaType.APPLICATION_JSON)
  public Response killUnusedSegmentsInInterval(
      @PathParam("dataSourceName") final String dataSourceName,
      @PathParam("interval") final String interval,
      @Context final HttpServletRequest req
  )
  {
    if (StringUtils.contains(interval, '_')) {
      log.warn("Use interval with '/', not '_': [%s] given", interval);
    }
    final Interval theInterval = Intervals.of(interval.replace('_', '/'));
    try {
      final String killTaskId = FutureUtils.getUnchecked(
          overlordClient.runKillTask("api-issued", dataSourceName, theInterval, null, null, null),
          true
      );
      auditManager.doAudit(
          AuditEntry.builder()
                    .key(dataSourceName)
                    .type("segment.kill")
                    .payload(ImmutableMap.of("killTaskId", killTaskId, "interval", theInterval))
                    .auditInfo(AuthorizationUtils.buildAuditInfo(req))
                    .request(AuthorizationUtils.buildRequestInfo("coordinator", req))
                    .build()
      );
      return Response.ok().build();
    }

View on GitHub (pinned to 9b90983fd2)