phacility/phabricator · error · Exception

The remote URI is not formatted correctly. Remote URIs with…

Error message

The remote URI is not formatted correctly. Remote URIs with an explicit protocol should be in the form '%s', not '%s'. The '%s' syntax is only valid in SCP-style URIs.

What it means

Error "The remote URI is not formatted correctly. Remote URIs with an explicit protocol should be in the form '%s', not '%s'. The '%s' syntax is only valid in SCP-style URIs." thrown in phacility/phabricator.

Solutions

  1. Write the URI as ssh://user@host/path (no colon before the path), or use SCP syntax user@host:path without the ssh:// prefix.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/repository/storage/PhabricatorRepository.php:1653 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/repository/storage/PhabricatorRepository.php:1653

    return $this;
  }

  public static function assertValidRemoteURI($uri) {
    if (trim($uri) != $uri) {
      throw new Exception(
        pht('The remote URI has leading or trailing whitespace.'));
    }

    $uri_object = new PhutilURI($uri);
    $protocol = $uri_object->getProtocol();

    // Catch confusion between Git/SCP-style URIs and normal URIs. See T3619
    // for discussion. This is usually a user adding "ssh://" to an implicit
    // SSH Git URI.
    if ($protocol == 'ssh') {
      if (preg_match('(^[^:@]+://[^/:]+:[^\d])', $uri)) {
        throw new Exception(
          pht(
            "The remote URI is not formatted correctly. Remote URIs ".
            "with an explicit protocol should be in the form ".
            "'%s', not '%s'. The '%s' syntax is only valid in SCP-style URIs.",
            'proto://domain/path',
            'proto://domain:/path',
            ':/path'));
      }
    }

    switch ($protocol) {
      case 'ssh':
      case 'http':
      case 'https':
      case 'git':
      case 'svn':
      case 'svn+ssh':
        break;

View on GitHub (pinned to 5720a38cfe)