phacility/phabricator · warning · PhabricatorApplicationTransactionValidationException
This alias is already in use.
Error message
This alias is already in use.
What it means
When applying Phurl URL transactions, PhabricatorPhurlURLEditor::didCatchDuplicateKeyException() traps the MySQL duplicate-key error on the unique alias column and rethrows it as PhabricatorApplicationTransactionValidationException with the human message 'This alias is already in use.'. It is a form-level validation error: the save is cleanly rejected with no partial write, and the error is attached to the alias transaction type.
Source
Thrown at src/applications/phurl/editor/PhabricatorPhurlURLEditor.php:107
PhabricatorEnv::getProductionURI('/U'.$object->getID()));
return $body;
}
protected function didCatchDuplicateKeyException(
PhabricatorLiskDAO $object,
array $xactions,
Exception $ex) {
$errors = array();
$errors[] = new PhabricatorApplicationTransactionValidationError(
PhabricatorPhurlURLAliasTransaction::TRANSACTIONTYPE,
pht('Duplicate'),
pht('This alias is already in use.'),
null);
throw new PhabricatorApplicationTransactionValidationException($errors);
}
protected function buildReplyHandler(PhabricatorLiskDAO $object) {
return id(new PhabricatorPhurlURLReplyHandler())
->setMailReceiver($object);
}
}
View on GitHub (pinned to 5720a38cfe)
Solutions
- Pick a different alias and resubmit
- If the alias appears unused, check for a soft-deleted URL still holding it and restore or destroy that row
- Catch PhabricatorApplicationTransactionValidationException and render the error next to the alias field instead of crashing
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check alias availability before applying transactions.
$conflict = id(new PhabricatorPhurlURLQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withAliases(array($alias))
->executeOne();
if ($conflict) {
// surface a field error now instead of failing the save
} Try / catch
try {
id(new PhabricatorPhurlURLEditor())
->setActor($viewer)
->setContentSource($source)
->applyTransactions($url, $xactions);
} catch (PhabricatorApplicationTransactionValidationException $ex) {
foreach ($ex->getErrors() as $error) {
// render 'This alias is already in use.' next to the alias field
}
} Prevention
- Check alias availability inline while the user types
- Treat soft-deleted URLs as alias holders until destroyed
- Catch the validation exception type in editors so users see field errors, not crashes
When it happens
Trigger: Creating a Phurl URL, or renaming one, to an alias that another URL already holds, hitting the unique key on the alias column during the transaction.
Common situations: Two users claiming the same short alias concurrently; double-submitted forms; aliases still held by soft-deleted URLs so the alias looks free in the list but is not.
Related errors
- This email address is already in use.
- The email address "%s" is already attached to this account.
- Service "%s" is unrecognized, restricted, or you do not have
- When creating a new Almanac interface via the Conduit API, y
- Device "%s" is unrecognized, restricted, or you do not have
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/a1d3a62c9d3fa541.
Report an issue: GitHub.