phacility/phabricator · error · DiffusionCommitHookRejectException

This push was rejected by custom hook script '%s': %s%s

Error message

This push was rejected by custom hook script '%s':

%s%s

What it means

Error "This push was rejected by custom hook script '%s': %s%s" thrown in phacility/phabricator.

Source

Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:690

        // NOTE: We're explicitly running the hooks in sequential order to
        // make this more predictable.
        $future = id(new ExecFuture('%s %Ls', $hook, $args))
          ->setEnv($env, $wipe_process_env = false)
          ->write($stdin);

        list($err, $stdout, $stderr) = $future->resolve();
        if (!$err) {
          // This hook ran OK, but echo its output in case there was something
          // informative.
          $console->writeOut('%s', $stdout);
          $console->writeErr('%s', $stderr);
          continue;
        }

        $this->rejectCode = PhabricatorRepositoryPushLog::REJECT_EXTERNAL;
        $this->rejectDetails = basename($hook);

        throw new DiffusionCommitHookRejectException(
          pht(
            "This push was rejected by custom hook script '%s':\n\n%s%s",
            basename($hook),
            $stdout,
            $stderr));
      }
    }
  }

  private function getExecutablesInDirectory($directory) {
    $executables = array();

    if (!Filesystem::pathExists($directory)) {
      return $executables;
    }

    foreach (Filesystem::listDirectory($directory) as $path) {
      $full_path = $directory.DIRECTORY_SEPARATOR.$path;

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:690 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/5c3a1e360909e01a. Report an issue: GitHub.