phacility/phabricator · info · PhutilArgumentUsageException
Specify a path to look up with
Error message
Specify a path to look up with `%s`.
What it means
Usage error from the 'bin/repository cache' workflow: --commit was provided and resolved via loadNamedCommit, but --path was not supplied. The command needs both a commit and a path to look up the last-modified graph cache entry; it aborts with PhutilArgumentUsageException before querying anything.
Solutions
- Re-run with both flags: 'bin/repository cache --commit <sha> --path /src/file.php'
- Check 'bin/repository cache --help' to review the options
Example fix
# before bin/repository cache --commit abc123ef # after bin/repository cache --commit abc123ef --path /src
Defensive patterns
Strategy: validation
Validate before calling
if (!isset($opts['commit']) || !isset($opts['path'])) {
fwrite(STDERR, "usage: bin/repository cache --commit <sha> --path <path>\n");
exit(1);
} Prevention
- Treat --commit and --path as an inseparable pair for the cache workflow
- Automate cache debugging through a wrapper that validates flags first
When it happens
Trigger: Running 'bin/repository cache --commit <sha>' alone; forgetting the path half of the lookup pair during cache debugging.
Common situations: Admin testing whether a specific commit is cached and forgetting that the lookup is per (commit, path) pair.
Understand the failure class
Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.
Related errors
- Path " " is not unknown.
- Specify a commit to look up with
- Atomizer class ' ' must be a concrete subclass of .
- Cache purger " " is not recognized. Available caches are: .
- Choosing steps with "--importing" conflicts with flags…
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/b66b725cf7d359b7.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php:40
'help' => pht('Specify a path to look up.'),
),
));
}
public function execute(PhutilArgumentParser $args) {
$commit_name = $args->getArg('commit');
if ($commit_name === null) {
throw new PhutilArgumentUsageException(
pht(
'Specify a commit to look up with `%s`.',
'--commit'));
}
$commit = $this->loadNamedCommit($commit_name);
$path_name = $args->getArg('path');
if ($path_name === null) {
throw new PhutilArgumentUsageException(
pht(
'Specify a path to look up with `%s`.',
'--path'));
}
$path_map = id(new DiffusionPathIDQuery(array($path_name)))
->loadPathIDs();
if (empty($path_map[$path_name])) {
throw new PhutilArgumentUsageException(
pht('Path "%s" is not unknown.', $path_name));
}
$path_id = $path_map[$path_name];
$graph_cache = new PhabricatorRepositoryGraphCache();
$t_start = microtime(true);
$cache_result = $graph_cache->loadLastModifiedCommitID(
$commit->getID(),View on GitHub (pinned to 5720a38cfe)