phacility/phabricator · warning · PhutilArgumentUsageException
Provide a list of objects to index (like "D123"), or a set o
Error message
Provide a list of objects to index (like "D123"), or a set of query constraint flags (like "--type"), or "--all" to index all objects.
What it means
Usage exception from `bin/search index`: no document selector was supplied. The workflow requires either positional object names, at least one constraint flag (--type, --version, --min-index-date, --max-index-date), or --all. A bare invocation is ambiguous - it could mean 'everything', which is expensive - so it fails fast instead of guessing.
Source
Thrown at src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php:110
$object_names = $args->getArg('objects');
$any_constraints =
($object_names) ||
($object_types) ||
($index_versions) ||
($min_epoch) ||
($max_epoch);
if ($is_all && $any_constraints) {
throw new PhutilArgumentUsageException(
pht(
'You can not use query constraint flags (like "--version", '.
'"--type", or a list of specific objects) with "--all".'));
}
if (!$is_all && !$any_constraints) {
throw new PhutilArgumentUsageException(
pht(
'Provide a list of objects to index (like "D123"), or a set of '.
'query constraint flags (like "--type"), or "--all" to index '.
'all objects.'));
}
if ($args->getArg('background')) {
$is_background = true;
} else {
PhabricatorWorker::setRunAllTasksInProcess(true);
$is_background = false;
}
if (!$is_background) {
$this->logInfo(
pht('NOTE'),
pht(View on GitHub (pinned to 5720a38cfe)
Solutions
- Name objects explicitly: `bin/search index D123 T456`
- Or constrain by type: `bin/search index --type task`
- Or index everything: `bin/search index --all` (slow on large installs)
- Combine constraints such as `--type task --min-index-date` for batched runs
Example fix
# before bin/search index # after bin/search index --type task
Defensive patterns
Strategy: validation
Validate before calling
$isAll = !empty($args['all']);
$hasSelector = !empty($args['objects']) || !empty($args['type'])
|| !empty($args['version']) || !empty($args['min-index-date'])
|| !empty($args['max-index-date']);
if (!$isAll && !$hasSelector) {
// refuse before invoking: require an explicit selector
} Prevention
- Always pass an explicit selector (names, --type, or --all)
- In cron jobs, pin the exact command and test it after Phabricator upgrades
- Fail scripts early when a computed selector list is empty
When it happens
Trigger: Running `bin/search index` with no arguments and no flags, or a script whose variable expansion produced an empty argument list.
Common situations: Exploring the CLI; assumptions that bare `bin/search index` reindexes everything (older behavior in some forks/scripts); truncated or misquoted shell commands in cron.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Specify a query with --query.
- Specify a commit to extract the diff from.
- Specify an atomizer class with %s.
- Specify a rule to edit with "--rule <id|monogram>".
- Use flags to specify at least one edit to apply to the rule
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/338b782a33bf6ac6.
Report an issue: GitHub.