Skip to content

Period values such as prune --older-than 99999999999d and check --fresh ts=99999999999d crash with a traceback #108

Closed

Description

@laaielichter

Every place that reads a period like 24h or 30d goes through parse_period. A huge number makes it raise OverflowError, which nothing catches, so the CLI prints a Python traceback:

gulliver prune --older-than 99999999999d --dry-run --json
# OverflowError: Python int too large to convert to C int

gulliver check events --not-null event_id --fresh ts=99999999999d --json
# OverflowError: Python int too large to convert to C int

A bad period such as --older-than abc already gives a clean message ("period looks like '1d', '24h', '7 days' or '30 min'"), so the fix is to make parse_period treat an impossible size the same way: raise a ValueError with a clear message, which the callers already turn into status: "error". Please check that both commands above (and gulliver incremental, which also uses parse_period) then return an error with exit code 1 and not a traceback. Note that PR #100 touches the negative --lookback check in incremental, so keep your change to parse_period and its callers.

Where to start

  • src/gulliver/incremental.py (around line 26): parse_period and PERIOD_RE
  • src/gulliver/runaway.py (around line 535): prune(...) calls parse_period directly, so check what happens to the ValueError there
  • src/gulliver/checks.py: parse_spec calls parse_period for --fresh ("validate early")
  • Tests: tests/test_incremental.py, tests/test_runaway.py, tests/test_checks.py

Done when

  • parse_period("99999999999d") (and the same size in hours, minutes and weeks) raises ValueError with a clear message; valid periods behave exactly as before
  • prune --older-than, check --fresh and incremental --period with such a value return status: "error" and exit code 1, with no traceback
  • A test for each of the three commands, through main([...]) where there is a CLI path
  • A line under Unreleased in CHANGELOG.md
  • pytest and ruff check . pass

Comment here to claim it and you'll be assigned.

Activity

  1. laaielichter commented on Nov 10, 2026

    @laaielichter
    OwnerAuthor

    @draarivpatel-ui, I tried to assign this issue to you, but GitHub only lets me assign people who have commented on the issue, and there is no comment from you here yet. That is fine: no one else has claimed #108, and your PR #110 is the only one for it, so it stays yours. If you would like the assignment to show, a one-line comment here ("I'm on this") is enough, and for the next issue it is the easiest way to be sure nobody else starts the same work.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions