phacility/phabricator · error · Exception
Collided mid-air when generating builtin file
Error message
Collided mid-air when generating builtin file "%s", but then failed to load the object we collided with.
What it means
Rarity guard while generating a builtin file: two concurrent processes raced to create the same builtin, the loser hit a duplicate-key error, but the re-query for the winner's row then found nothing — an inconsistent race outcome that should not occur.
Solutions
- Retry builtin generation; the winner should now exist and the load will succeed
- Check for unusually aggressive concurrent warmup of the same builtin key
- Investigate replication lag if reads go to a lagged replica
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/applications/files/storage/PhabricatorFile.php:1202 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/b00af73b0aa8d7f0.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/files/storage/PhabricatorFile.php:1202
$data = $builtin->loadBuiltinFileData();
$params = array(
'name' => $builtin->getBuiltinDisplayName(),
'canCDN' => true,
'builtin' => $key,
);
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
try {
$file = self::newFromFileData($data, $params);
} catch (AphrontDuplicateKeyQueryException $ex) {
$file = id(new PhabricatorFileQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withBuiltinKeys(array($key))
->executeOne();
if (!$file) {
throw new Exception(
pht(
'Collided mid-air when generating builtin file "%s", but '.
'then failed to load the object we collided with.',
$key));
}
}
unset($unguarded);
$file->attachObjectPHIDs(array());
$file->attachObjects(array());
$results[$key] = $file;
}
return $results;
}
View on GitHub (pinned to 5720a38cfe)