phacility/phabricator · error · Exception

Repository "%s" does not have a correctly configured remote

Error message

Repository "%s" does not have a correctly configured remote URI. The remote URI for a Subversion repository MUST point at the repository root. The root for this repository is "%s", but the configured URI is "%s". To resolve this error, set the remote URI to point at the repository root. If you want to import only part of a Subversion repository, use the "Import Only" option.

What it means

Thrown during Subversion discovery when the configured remote URI does not normalize to the repository root that SVN itself reports. Phabricator requires an SVN remote URI to point exactly at the repository root because it computes paths and history relative to that root; the code normalizes both the remote root and the expected root with ArcanistRepositoryURINormalizer and compares them. The Import Only (subpath) mechanism exists for importing only part of an SVN repository.

Source

Thrown at src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:329

    $xml = phutil_utf8ize($xml);
    $xml = new SimpleXMLElement($xml);

    $remote_root = (string)($xml->entry[0]->repository[0]->root[0]);
    $expect_root = $repository->getSubversionPathURI();

    $normal_type_svn = ArcanistRepositoryURINormalizer::TYPE_SVN;

    $remote_normal = id(new ArcanistRepositoryURINormalizer(
      $normal_type_svn,
      $remote_root))->getNormalizedPath();

    $expect_normal = id(new ArcanistRepositoryURINormalizer(
      $normal_type_svn,
      $expect_root))->getNormalizedPath();

    if ($remote_normal != $expect_normal) {
      throw new Exception(
        pht(
          'Repository "%s" does not have a correctly configured remote URI. '.
          'The remote URI for a Subversion repository MUST point at the '.
          'repository root. The root for this repository is "%s", but the '.
          'configured URI is "%s". To resolve this error, set the remote URI '.
          'to point at the repository root. If you want to import only part '.
          'of a Subversion repository, use the "Import Only" option.',
          $repository->getDisplayName(),
          $remote_root,
          $expect_root));
    }
  }


/* -(  Discovering Mercurial Repositories  )--------------------------------- */


  /**

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Set the repository remote URI to the SVN repository root (the Repository Root reported by 'svn info')
  2. If you only want part of the repository, configure the Import Only path on the repository edit page instead of pointing the URI at a subdirectory
  3. Verify with 'svn info <uri>' that Repository Root matches the configured URI exactly
  4. Re-run discovery after fixing the URI

Example fix

# before
# remote URI: svn://svn.example.com/calculator/trunk

# after
# remote URI: svn://svn.example.com/calculator
# plus, in repository config, 'Import Only' (subpath): trunk
Defensive patterns

Strategy: validation

Validate before calling

// SVN: verify the URI points at the repository root before discovery:
list($out) = execx('svn info %s', $remote_uri);
// parse 'Repository Root:' from $out and require:
//   normalized($remote_uri) == normalized($repository_root)

Prevention

When it happens

Trigger: Configuring an SVN repository whose remote URI points at a subdirectory such as svn://host/repo/trunk instead of svn://host/repo; normalization differences between the configured URI and the root reported by 'svn info'; editing the URI after initial import to a non-root path.

Common situations: Admins importing only trunk by pointing the remote URI at it instead of using Import Only; typos or missing path segments in the remote URI; migrating from workflows where subdirectory URIs are common.

Related errors


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