phacility/phabricator · error · PhutilArgumentUsageException
Specify a message to send with "--message".
Error message
Specify a message to send with "--message".
What it means
Usage error from the Aphlict notify workflow: --message was omitted or empty. The check strlen($message) runs after the target user resolved successfully, and the workflow refuses to send an empty notification.
Source
Thrown at src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php:49
pht(
'Specify a user to notify with "--user".'));
}
$user = id(new PhabricatorPeopleQuery())
->setViewer($viewer)
->withUsernames(array($username))
->executeOne();
if (!$user) {
throw new PhutilArgumentUsageException(
pht(
'No user with username "%s" exists.',
$username));
}
$message = $args->getArg('message');
if (!strlen($message)) {
throw new PhutilArgumentUsageException(
pht(
'Specify a message to send with "--message".'));
}
$application_phid = id(new PhabricatorNotificationsApplication())
->getPHID();
$content_source = $this->newContentSource();
$xactions = array();
$xactions[] = id(new PhabricatorUserTransaction())
->setTransactionType(
PhabricatorUserNotifyTransaction::TRANSACTIONTYPE)
->setNewValue($message)
->setForceNotifyPHIDs(array($user->getPHID()));
$editor = id(new PhabricatorUserTransactionEditor())View on GitHub (pinned to 5720a38cfe)
Solutions
- Include a non-empty --message: ./bin/aphlict notify --user admin --message 'test ping'.
- In scripts, default the message: MSG="${MSG:-default notification text}".
- Skip the call entirely when the computed message is empty rather than invoking with ''.
Defensive patterns
Strategy: validation
Validate before calling
// Guard before invoking:
// MSG="${MSG:-default notification text}"
// [ -n "$MSG" ] && ./bin/aphlict notify --user "$USER" --message "$MSG"
if (!strlen($message)) {
// skip sending rather than invoking with an empty --message
return;
} Try / catch
try {
// execute notify workflow
} catch (PhutilArgumentUsageException $ex) {
if (preg_match('/Specify a message to send/', $ex->getMessage())) {
// Message source produced empty text: fix upstream, do not blind-retry.
}
throw $ex;
} Prevention
- Default or assert non-empty message text in scripts before calling notify.
- Skip the notification when the computed message is empty (e.g. no new log lines).
- Treat an empty message as a data problem upstream, not a CLI problem.
When it happens
Trigger: Running the notify workflow with --user but without --message, or with --message '' (empty string), e.g. an unexpanded variable in automation.
Common situations: Smoke-test commands that only pass --user; scripts building the message from a variable that is empty when a log file has no new lines.
Related errors
- Specify a user to notify with "--user".
- No user with username "%s" exists.
- Request parameter "%s" is not formatted properly. Expected a
- Specify a public key to revoke trust for with --id.
- Failed to read configuration file. %s
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/5966d9abfef9ce93.
Report an issue: GitHub.