phacility/phabricator · error · Exception
Unrecognized repository path "%s". Expected a path like "%s"
Error message
Unrecognized repository path "%s". Expected a path like "%s", "%s", or "%s".
What it means
The SSH path is interpreted by PhabricatorRepository::parseRepositoryServicePath, which only accepts the documented forms: /diffusion/<CALLSIGN>/, /diffusion/<id>/, or /<shortname>.git (like /source/thaumaturgy.git). Anything else returns null and loadRepositoryWithPath throws, listing the expected forms.
Source
Thrown at src/applications/diffusion/ssh/DiffusionSSHWorkflow.php:214
'ssh',
),
));
$this->shouldProxy = (bool)$uri;
try {
return $this->executeRepositoryOperations();
} catch (Exception $ex) {
$this->writeError(get_class($ex).': '.$ex->getMessage());
return 1;
}
}
protected function loadRepositoryWithPath($path, $vcs) {
$viewer = $this->getSSHUser();
$info = PhabricatorRepository::parseRepositoryServicePath($path, $vcs);
if ($info === null) {
throw new Exception(
pht(
'Unrecognized repository path "%s". Expected a path like "%s", '.
'"%s", or "%s".',
$path,
'/diffusion/X/',
'/diffusion/123/',
'/source/thaumaturgy.git'));
}
$identifier = $info['identifier'];
$base = $info['base'];
$this->baseRequestPath = $base;
$repository = id(new PhabricatorRepositoryQuery())
->setViewer($viewer)
->withIdentifiers(array($identifier))
->needURIs(true)View on GitHub (pinned to 5720a38cfe)
Solutions
- Copy the exact clone URI from the repository's Diffusion main page (it includes the trailing slash)
- To use /source/<shortname>.git, give the repository a short name and enable that URI
- Prefer the numeric /diffusion/<id>/ form in automation because it survives callsign renames
Example fix
# before git clone ssh://git@host/diffusion/X # after git clone ssh://git@host/diffusion/X/
Defensive patterns
Strategy: validation
Validate before calling
// Validate the clone path shape before connecting
if (!preg_match('@^/(diffusion/[A-Z]+|diffusion/[0-9]+|source/[^.]+\.git)/$@', $ssh_path)) {
// fix the URL instead of hitting 'Unrecognized repository path'
} Type guard
function isValidRepositoryServicePath($path) {
return (bool)preg_match(
'@^/(diffusion/[A-Z]+|diffusion/[0-9]+|source/[^.]+\.git)/$@',
$path);
} Prevention
- Always copy the clone URI from the repository's Diffusion page (trailing slash included)
- In automation, prefer the numeric /diffusion/<id>/ form
- Enable shortname URIs before advertising /source/<shortname>.git to developers
When it happens
Trigger: Cloning with a malformed path: missing trailing slash (ssh://user@host/diffusion/X), unsupported roots (/repos/X.git), or using the /source/<shortname>.git form when the repository has no short name or shortname URIs are not enabled.
Common situations: Hand-typed clone URLs; scripts written against other hosting services; copying the path from the wrong URI field instead of the clone URI shown in the UI.
Related errors
- This public key is already associated with another user or d
- Analyzing or decrypting SSH keys requires the "ssh-keygen" b
- A passphrase was provided for this private key, but it does
- This private key is not formatted correctly. Check that you
- This private key requires a passphrase, but the wrong passph
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/88873538c7f10242.
Report an issue: GitHub.