{"record":{"id":"6a09764a07259cb0","repo":"phacility/phabricator","slug":"repository-identifier-s-in-hint-at-index-s","errorCode":null,"errorMessage":"Repository identifier \"%s\" (in hint at index \"%s\") does not identify a valid repository.","messagePattern":"Repository identifier \"(.+?)\" \\(in hint at index \"(.+?)\"\\) does not identify a valid repository\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementHintWorkflow.php","lineNumber":72,"sourceCode":"            'hint' => 'string',\n          ));\n      } catch (Exception $ex) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Unexpected hint format at index \"%s\": %s',\n            $idx,\n            $ex->getMessage()));\n      }\n\n      $repository_identifier = $hint['repository'];\n      $repository = idx($repositories, $repository_identifier);\n      if (!$repository) {\n        $repository = id(new PhabricatorRepositoryQuery())\n          ->setViewer($viewer)\n          ->withIdentifiers(array($repository_identifier))\n          ->executeOne();\n        if (!$repository) {\n          throw new PhutilArgumentUsageException(\n            pht(\n              'Repository identifier \"%s\" (in hint at index \"%s\") does not '.\n              'identify a valid repository.',\n              $repository_identifier,\n              $idx));\n        }\n\n        $repositories[$repository_identifier] = $repository;\n      }\n\n      PhabricatorRepositoryCommitHint::updateHint(\n        $repository->getPHID(),\n        $hint['old'],\n        idx($hint, 'new'),\n        $hint['hint']);\n\n      echo tsprintf(\n        \"%s\\n\",","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementHintWorkflow.php#L54-L90","documentation":"Thrown by `bin/repository hint` when `PhabricatorRepositoryQuery->withIdentifiers([...])->executeOne()` returns no result for a hint's `repository` value. The identifier may be a repository ID (int) or callsign (string); if neither matches a visible repository, processing stops before `PhabricatorRepositoryCommitHint::updateHint()` is called. Note the query runs with the acting viewer, so permission filtering also applies.","triggerScenarios":"A callsign typo (`RR1` instead of `R1`); using the PHID (e.g. `PHID-REPO-xyz`) which withIdentifiers may not resolve; a numeric string ID for a deleted repository; running the workflow as a system/daemon user whose viewer cannot see the repository (policy filtering); identifier correct but repository row soft-deleted.","commonSituations":"Hint files generated from an older Phabricator instance after repositories were renamed or re-created; scripts copy the Git remote URL instead of the Phabricator callsign into `repository`; running via sudo with a different acting user that lacks visibility.","solutions":["Correct the identifier: use the repository callsign (e.g. `R123`) or numeric ID exactly as shown in Diffusion.","Cross-check it exists: open Diffusion → the repository, or run `./bin/repository list`.","If generating hints programmatically, resolve callsigns via `PhabricatorRepositoryQuery` before writing the file.","Run the command as an administrative user (e.g. `./bin/repository hint` under the phabricator ops user, or with `--actor`) so policy filtering does not hide the repository."],"exampleFix":"// before\n[{\"repository\":\"RR1\",\"old\":\"deadbeef\",\"hint\":\"obsolete\"}]\n// RR1 is a typo -> [1164] Repository identifier \"RR1\" ... does not identify a valid repository.\n\n// after\n[{\"repository\":\"R1\",\"old\":\"deadbeef\",\"hint\":\"obsolete\"}]","handlingStrategy":"validation","validationCode":"# Confirm the callsign resolves before running the hint import:\n./bin/repository list | grep -w R1 || { echo 'unknown repository R1' >&2; exit 1; }\n./bin/repository hint < hints.json","typeGuard":"function resolve_repository($viewer, $identifier) {\n  return id(new PhabricatorRepositoryQuery())\n    ->setViewer($viewer)\n    ->withIdentifiers(array($identifier))\n    ->executeOne(); // null => would trigger [1164]; check before updateHint()\n}","tryCatchPattern":null,"preventionTips":["Use callsigns exactly as shown in Diffusion (R + letters), not PHIDs or remote URLs.","When hints come from another instance, map callsigns through a lookup table rather than trusting the old names.","Run as an admin/ops user so policy filtering cannot hide the repository from withIdentifiers()."],"tags":["phabricator","phorge","repository","entity-not-found","cli"],"backgroundTag":"entity-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}