{"record":{"id":"4da2323a5e3b6e4c","repo":"phacility/phabricator","slug":"the-remote-uri-has-leading-or-trailing-whitespace","errorCode":null,"errorMessage":"The remote URI has leading or trailing whitespace.","messagePattern":"The remote URI has leading or trailing whitespace\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/storage/PhabricatorRepository.php","lineNumber":1641,"sourceCode":"                VALUES(messageCount)),\n            statusCode = VALUES(statusCode),\n            parameters = VALUES(parameters),\n            epoch = VALUES(epoch)',\n        $table_name,\n        $this->getID(),\n        $status_type,\n        $status_code,\n        json_encode($parameters),\n        time(),\n        1);\n    }\n\n    return $this;\n  }\n\n  public static function assertValidRemoteURI($uri) {\n    if (trim($uri) != $uri) {\n      throw new Exception(\n        pht('The remote URI has leading or trailing whitespace.'));\n    }\n\n    $uri_object = new PhutilURI($uri);\n    $protocol = $uri_object->getProtocol();\n\n    // Catch confusion between Git/SCP-style URIs and normal URIs. See T3619\n    // for discussion. This is usually a user adding \"ssh://\" to an implicit\n    // SSH Git URI.\n    if ($protocol == 'ssh') {\n      if (preg_match('(^[^:@]+://[^/:]+:[^\\d])', $uri)) {\n        throw new Exception(\n          pht(\n            \"The remote URI is not formatted correctly. Remote URIs \".\n            \"with an explicit protocol should be in the form \".\n            \"'%s', not '%s'. The '%s' syntax is only valid in SCP-style URIs.\",\n            'proto://domain/path',\n            'proto://domain:/path',","sourceCodeStart":1623,"sourceCodeEnd":1659,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/storage/PhabricatorRepository.php#L1623-L1659","documentation":"Error \"The remote URI has leading or trailing whitespace.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/repository/storage/PhabricatorRepository.php:1641 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}