phacility/phabricator · error · Exception

Repository ("%s") has unsupported VCS ("%s").

Error message

Repository ("%s") has unsupported VCS ("%s").

What it means

Thrown by loadRepositories() in the working-copy blueprint when a repository referenced by 'repositories.map' exists but its version control system is anything other than Git (the switch only accepts PhabricatorRepositoryType::REPOSITORY_TYPE_GIT). Drydock working copies are implemented exclusively with git clone/fetch commands, so Subversion and Mercurial repositories cannot be used. The failing repository's PHID and its VCS type are included in the message.

Source

Thrown at src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php:445

      ->execute();
    $repositories = mpull($repositories, null, 'getPHID');

    foreach ($phids as $phid) {
      if (empty($repositories[$phid])) {
        throw new Exception(
          pht(
            'Repository PHID "%s" does not exist.',
            $phid));
      }
    }

    foreach ($repositories as $repository) {
      $repository_vcs = $repository->getVersionControlSystem();
      switch ($repository_vcs) {
        case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
          break;
        default:
          throw new Exception(
            pht(
              'Repository ("%s") has unsupported VCS ("%s").',
              $repository->getPHID(),
              $repository_vcs));
      }
    }

    return $repositories;
  }

  private function loadHostLease(DrydockResource $resource) {
    $viewer = $this->getViewer();

    $lease_phid = $resource->getAttribute('host.leasePHID');

    $lease = id(new DrydockLeaseQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($lease_phid))

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Point the repositories.map entry at the Git mirror/counterpart of the repository and re-create the lease.
  2. If the repository must be SVN/Mercurial, do not use the working-copy blueprint for it; run builds against it with a different mechanism or blueprint type.
  3. Filter candidate repositories by VCS in the code that builds the map so only Git PHIDs ever reach Drydock.

Example fix

// before
$map['src']['phid'] = $svn_repository->getPHID();

// after
if ($repository->getVersionControlSystem()
    !== PhabricatorRepositoryType::REPOSITORY_TYPE_GIT) {
  continue;
}
$map['src']['phid'] = $repository->getPHID();
Defensive patterns

Strategy: type-guard

Type guard

function isGitRepository(PhabricatorRepository $repository) {
  return $repository->getVersionControlSystem()
    === PhabricatorRepositoryType::REPOSITORY_TYPE_GIT;
}

// when building repositories.map:
foreach ($candidates as $repo) {
  if (!isGitRepository($repo)) {
    continue; // skip SVN/Mercurial instead of failing during activation
  }
  $map[$dir]['phid'] = $repo->getPHID();
}

Prevention

When it happens

Trigger: A lease or resource attribute maps a directory to an SVN or Mercurial repository (getVersionControlSystem() returns REPOSITORY_TYPE_SVN or REPOSITORY_TYPE_MERCURIAL). Activation calls loadRepositories(), the VCS switch falls through to default, and the exception aborts activateResource()/activateLease().

Common situations: A project migrates a repository from SVN to Git but automation still references the old SVN repository; a mixed Diffusion install where the lease author picked the wrong repository; lease attributes generated by a script that does not filter repositories by VCS type.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/da0aa4b431a6794f. Report an issue: GitHub.