{"record":{"id":"86de50099716dfb1","repo":"phacility/phabricator","slug":"specify-one-or-more-repositories-to-discover","errorCode":null,"errorMessage":"Specify one or more repositories to discover.","messagePattern":"Specify one or more repositories to discover\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"info","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php","lineNumber":34,"sourceCode":"          ),\n          array(\n            'name' => 'repair',\n            'help' => pht(\n              'Discover all commits, even if they are ancestors of known '.\n              'commits. This can repair gaps in repository history.'),\n          ),\n          array(\n            'name' => 'repos',\n            'wildcard' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $repos = $this->loadLocalRepositories($args, 'repos');\n\n    if (!$repos) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify one or more repositories to discover.'));\n    }\n\n    $console = PhutilConsole::getConsole();\n    foreach ($repos as $repo) {\n      $console->writeOut(\n        \"%s\\n\",\n        pht(\n          'Discovering \"%s\"...',\n          $repo->getDisplayName()));\n\n      id(new PhabricatorRepositoryDiscoveryEngine())\n        ->setRepository($repo)\n        ->setVerbose($args->getArg('verbose'))\n        ->setRepairMode($args->getArg('repair'))\n        ->discoverCommits();\n    }\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php#L16-L52","documentation":"Usage error from 'bin/repository discover': the wildcard 'repos' argument resolved to zero repositories via loadLocalRepositories(). Besides being omitted entirely, names resolve to nothing when callsigns are wrong or the repositories are not local (hosted or observed) repositories eligible for this workflow. The command aborts before starting any discovery engine.","triggerScenarios":"Running 'bin/repository discover' bare, or with callsigns that do not exist or contain typos; targeting repositories whose hosting state is not set up for local discovery.","commonSituations":"Admin runs discover to unstick an import but mistypes the callsign; attempting discovery before the repository record is fully configured.","solutions":["Pass valid repository callsigns or monograms: 'bin/repository discover ABC' (verify on /diffusion/ or via repository search)","Check spelling and case of callsigns","Ensure the repository is set up for local discovery (hosted or observing with a local working copy)"],"exampleFix":"# before\nbin/repository discover\n\n# after\nbin/repository discover ABC","handlingStrategy":"validation","validationCode":"// Resolve callsigns to repositories before invoking discover:\n$repos = id(new PhabricatorRepositoryQuery())\n  ->setViewer($viewer)\n  ->withCallsigns($callsigns)\n  ->execute();\nif (!$repos) {\n  fwrite(STDERR, \"no matching repositories; check callsigns\\n\");\n  exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pull callsigns from /diffusion/ or repository search instead of memory","Ensure the repository is configured for local hosting or observing before discovery","Batch callsigns in one discover invocation and validate the list first"],"tags":["phabricator","cli","usage-error","discovery"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}