{"record":{"id":"237598abf691353c","repo":"phacility/phabricator","slug":"object-s-claims-s-is-a-github-repository-u-237598","errorCode":null,"errorMessage":"Object (\"%s\") claims \"%s\" is a GitHub repository URI, but the path (\"%s\") does not have enough components (expected at least two).","messagePattern":"Object \\(\"(.+?)\"\\) claims \"(.+?)\" is a GitHub repository URI, but the path \\(\"(.+?)\"\\) does not have enough components \\(expected at least two\\)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php","lineNumber":122,"sourceCode":"\n    $github_uri = $object->getCircleCIGitHubRepositoryURI();\n    $build_type = $object->getCircleCIBuildIdentifierType();\n    $build_identifier = $object->getCircleCIBuildIdentifier();\n\n    $path = self::getGitHubPath($github_uri);\n    if ($path === null) {\n      throw new Exception(\n        pht(\n          'Object (\"%s\") claims \"%s\" is a GitHub repository URI, but the '.\n          'domain does not appear to be GitHub.',\n          $object_phid,\n          $github_uri));\n    }\n\n    $path_parts = trim($path, '/');\n    $path_parts = explode('/', $path_parts);\n    if (count($path_parts) < 2) {\n      throw new Exception(\n        pht(\n          'Object (\"%s\") claims \"%s\" is a GitHub repository URI, but the '.\n          'path (\"%s\") does not have enough components (expected at least '.\n          'two).',\n          $object_phid,\n          $github_uri,\n          $path));\n    }\n\n    list($github_namespace, $github_name) = $path_parts;\n    $github_name = preg_replace('(\\\\.git$)', '', $github_name);\n\n    $credential_phid = $this->getSetting('token');\n    $api_token = id(new PassphraseCredentialQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($credential_phid))\n      ->needSecrets(true)\n      ->executeOne();","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php#L104-L140","documentation":"The URI from getCircleCIGitHubRepositoryURI() passed the github.com domain check, but after trimming slashes its path splits into fewer than two components. The CircleCI v1 API endpoint this step builds (circleci.com/api/v1/project/{namespace}/{name}) needs an owner and a repository name, so a path like \"/\" or \"/owner\" cannot be used. The check is count($path_parts) < 2 after trim($path, '/') and explode('/').","triggerScenarios":"getCircleCIGitHubRepositoryURI() returns something like 'https://github.com' (empty path), 'https://github.com/acme' (only an owner), or a URI whose path was stripped/mangled by the implementing class. The domain check passes, then the component count fails at HarbormasterCircleCIBuildStepImplementation.php:121.","commonSituations":"Staging or remote URI configured to a GitHub user/organization profile page instead of a repository; custom interface implementation that builds the URI from parts and drops the repo name; trailing-slash-only URIs such as 'https://github.com/'.","solutions":["Correct the URI so its path contains owner/repository, e.g. 'https://github.com/acme/app.git'.","If the URI comes from your own implementation of HarbormasterCircleCIBuildableInterface, return the full repository URI including the repository name.","Verify the Diffusion repository's staging URI / GitHub remote includes the repository directory, not just the namespace."],"exampleFix":"// before\n$github_uri = 'https://github.com/acme';\n\n// after\n$github_uri = 'https://github.com/acme/app.git';","handlingStrategy":"validation","validationCode":"$path = trim(HarbormasterCircleCIBuildStepImplementation::getGitHubPath($uri), '/');\nif (count(explode('/', $path)) < 2) {\n  // URI lacks owner/repository - fix before running the step\n}","typeGuard":"function isGitHubRepoPathComplete($uri) {\n  $path = HarbormasterCircleCIBuildStepImplementation::getGitHubPath($uri);\n  if ($path === null) {\n    return false;\n  }\n  return count(explode('/', trim($path, '/'))) >= 2;\n}","tryCatchPattern":null,"preventionTips":["Configure staging/remote URIs to the full repository path (owner/repo.git), never to a user profile page.","Validate generated URIs in interface implementations with a path-component count check."],"tags":["harbormaster","circleci","github","uri","phabricator"],"backgroundTag":"uri-path-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}