phacility/phabricator · warning · PhutilArgumentUsageException

Supplied --min-date is not valid. See help for valid example

Error message

Supplied --min-date is not valid. See help for valid examples.
Supplied value: '%s'

What it means

reparse feeds the `--min-date` value to PHP's strtotime(); a return value of false means the string is not a parseable date/time. The workflow surfaces the original value in this PhutilArgumentUsageException so the operator can correct the format.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:140

      throw new PhutilArgumentUsageException(
        pht(
          'Specify which steps to reparse with "--message", "--change", '.
          'and/or "--publish"; or "--importing" to run all missing steps.'));
    }

    $min_timestamp = false;
    if ($min_date) {
      $min_timestamp = strtotime($min_date);

      if (!$all_from_repo) {
        throw new PhutilArgumentUsageException(
          pht(
            'You must use "--all" if you specify "--min-date".'));
      }

      // previous to PHP 5.1.0 you would compare with -1, instead of false
      if (false === $min_timestamp) {
        throw new PhutilArgumentUsageException(
          pht(
            "Supplied --min-date is not valid. See help for valid examples.\n".
            "Supplied value: '%s'\n",
            $min_date));
      }
    }

    $commits = array();
    if ($all_from_repo) {
      $repository = id(new PhabricatorRepositoryQuery())
        ->setViewer(PhabricatorUser::getOmnipotentUser())
        ->withIdentifiers(array($all_from_repo))
        ->executeOne();

      if (!$repository) {
        throw new PhutilArgumentUsageException(
          pht('Unknown repository "%s"!', $all_from_repo));
      }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Use an unambiguous machine format strtotime() always parses, e.g. `--min-date '2020-01-01'` or an ISO-8601 timestamp `'2020-01-01T00:00:00Z'`.
  2. Quote the argument in the shell so spaces and special characters survive.
  3. If generating dates programmatically, normalize first (e.g. `date -u +%Y-%m-%d`).

Example fix

# before
./bin/repository reparse --all R --change --min-date 01/02/03
# Usage exception: Supplied --min-date is not valid... Supplied value: '01/02/03'

# after
./bin/repository reparse --all R --change --min-date '2020-01-01'
Defensive patterns

Strategy: validation

Validate before calling

# Normalize and verify the date before passing it
min_date=$(date -u -d "$USER_DATE" +%Y-%m-%dT%H:%M:%S 2>/dev/null) || {
  echo "unparseable date: $USER_DATE" >&2; exit 2;
}
./bin/repository reparse --all "$REPO" --change --min-date "$min_date"

Prevention

When it happens

Trigger: Passing an ambiguous or malformed date like `01/02/03`, `2020-13-45`, `yesterday noonish`, or a locale-specific format strtotime() rejects; unquoted values mangled by shell splitting.

Common situations: Scripts interpolating user input or environment variables into `--min-date`; timezone abbreviations or formats that differ from what the server's PHP accepts; copy-paste of dates with typographic dashes or spaces.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/b94268570b9f7f0f. Report an issue: GitHub.