{"record":{"id":"88873538c7f10242","repo":"phacility/phabricator","slug":"unrecognized-repository-path-s-expected-a-path","errorCode":null,"errorMessage":"Unrecognized repository path \"%s\". Expected a path like \"%s\", \"%s\", or \"%s\".","messagePattern":"Unrecognized repository path \"(.+?)\"\\. Expected a path like \"(.+?)\", \"(.+?)\", or \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/ssh/DiffusionSSHWorkflow.php","lineNumber":214,"sourceCode":"          'ssh',\n        ),\n      ));\n    $this->shouldProxy = (bool)$uri;\n\n    try {\n      return $this->executeRepositoryOperations();\n    } catch (Exception $ex) {\n      $this->writeError(get_class($ex).': '.$ex->getMessage());\n      return 1;\n    }\n  }\n\n  protected function loadRepositoryWithPath($path, $vcs) {\n    $viewer = $this->getSSHUser();\n\n    $info = PhabricatorRepository::parseRepositoryServicePath($path, $vcs);\n    if ($info === null) {\n      throw new Exception(\n        pht(\n          'Unrecognized repository path \"%s\". Expected a path like \"%s\", '.\n          '\"%s\", or \"%s\".',\n          $path,\n          '/diffusion/X/',\n          '/diffusion/123/',\n          '/source/thaumaturgy.git'));\n    }\n\n    $identifier = $info['identifier'];\n    $base = $info['base'];\n\n    $this->baseRequestPath = $base;\n\n    $repository = id(new PhabricatorRepositoryQuery())\n      ->setViewer($viewer)\n      ->withIdentifiers(array($identifier))\n      ->needURIs(true)","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php#L196-L232","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\ngit clone ssh://git@host/diffusion/X\n# after\ngit clone ssh://git@host/diffusion/X/","handlingStrategy":"validation","validationCode":"// Validate the clone path shape before connecting\nif (!preg_match('@^/(diffusion/[A-Z]+|diffusion/[0-9]+|source/[^.]+\\.git)/$@', $ssh_path)) {\n  // fix the URL instead of hitting 'Unrecognized repository path'\n}","typeGuard":"function isValidRepositoryServicePath($path) {\n  return (bool)preg_match(\n    '@^/(diffusion/[A-Z]+|diffusion/[0-9]+|source/[^.]+\\.git)/$@',\n    $path);\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["ssh","clone-url","path-validation"],"backgroundTag":"invalid-repository-path","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}