phacility/phabricator · error · Exception

Unable to find ` ` in !

Error message

Unable to find `%s` in %s!

What it means

Raised while preparing the environment for a Git SSH request in serveGitRequest: because the hook wipes the process environment (including PATH), each needed binary must be resolved to an absolute path first. This error means a required executable (e.g. git or a helper) could not be located in the searched PATH, so the command cannot be executed safely.

Solutions

  1. Install the missing executable on the VCS host
  2. Ensure the executable is in a standard location included in the resolved PATH
  3. Configure the binary's absolute path in Phabricator settings where supported
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/applications/diffusion/controller/DiffusionServeController.php:577 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/2de1755d906193ed. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/diffusion/controller/DiffusionServeController.php:577

    // issues where we might interpret inputs like "service=read&service=write"
    // differently than the server does and pass it an unsafe command.

    // NOTE: This does not use getPassthroughRequestParameters() because
    // that code is HTTP-method agnostic and will encode POST data.

    $query_data = $_GET;
    foreach ($query_data as $key => $value) {
      if (!strncmp($key, '__', 2)) {
        unset($query_data[$key]);
      }
    }
    $query_string = phutil_build_http_querystring($query_data);

    // We're about to wipe out PATH with the rest of the environment, so
    // resolve the binary first.
    $bin = Filesystem::resolveBinary('git-http-backend');
    if (!$bin) {
      throw new Exception(
        pht(
          'Unable to find `%s` in %s!',
          'git-http-backend',
          '$PATH'));
    }

    // NOTE: We do not set HTTP_CONTENT_ENCODING here, because we already
    // decompressed the request when we read the request body, so the body is
    // just plain data with no encoding.

    $env = array(
      'REQUEST_METHOD' => $_SERVER['REQUEST_METHOD'],
      'QUERY_STRING' => $query_string,
      'CONTENT_TYPE' => $request->getHTTPHeader('Content-Type'),
      'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'],
      'GIT_PROJECT_ROOT' => $repository_root,
      'GIT_HTTP_EXPORT_ALL' => '1',
      'PATH_INFO' => $request_path,

View on GitHub (pinned to 5720a38cfe)