floci-io/floci · error · AwsException

DataUnavailableException

DataUnavailableException

Error message

End date must be after Start date.

What it means

Error "End date must be after Start date." thrown in floci-io/floci.

Source

Thrown at src/main/java/io/github/hectorvent/floci/services/ce/TimeBucketing.java:69

        try {
            return OffsetDateTime.parse(value).toInstant();
        } catch (DateTimeParseException ignored) {
            // fall through
        }
        try {
            return LocalDateTime.parse(value).toInstant(ZoneOffset.UTC);
        } catch (DateTimeParseException e) {
            throw new AwsException("ValidationException",
                    field + " must be a YYYY-MM-DD date or ISO-8601 timestamp.", 400);
        }
    }

    /** A half-open [start, end) bucket aligned to the requested granularity. */
    record Bucket(Instant start, Instant end) {}

    static List<Bucket> split(Instant start, Instant end, Granularity granularity) {
        if (!end.isAfter(start)) {
            throw new AwsException("DataUnavailableException",
                    "End date must be after Start date.", 400);
        }
        // Truncate Start down and End up to the granularity boundary so every
        // emitted bucket aligns to the period AWS would return.
        Instant alignedStart = floor(start, granularity);
        Instant alignedEnd = ceil(end, granularity);
        return switch (granularity) {
            case HOURLY -> splitHourly(alignedStart, alignedEnd);
            case DAILY -> splitDaily(alignedStart, alignedEnd);
            case MONTHLY -> splitMonthly(alignedStart, alignedEnd);
        };
    }

    private static Instant floor(Instant instant, Granularity granularity) {
        return switch (granularity) {
            case HOURLY -> instant.truncatedTo(java.time.temporal.ChronoUnit.HOURS);
            case DAILY -> instant.truncatedTo(java.time.temporal.ChronoUnit.DAYS);
            case MONTHLY -> YearMonth.from(instant.atOffset(ZoneOffset.UTC))

View on GitHub (pinned to 62ff490619)

Solutions

  1. Provide a TimePeriod where End is later than Start.

When it happens

Trigger: Thrown at src/main/java/io/github/hectorvent/floci/services/ce/TimeBucketing.java:69 when the library encounters an invalid state.

Common situations: Occurs when the TimePeriod End date is not strictly after the Start date. Provide an End date later than the Start date.


AI-assisted analysis of floci-io/floci@62ff490619 (2026-08-14). Data as JSON: /api/errors/5d5653c2410de019. Report an issue: GitHub.