{"record":{"id":"5c3a1e360909e01a","repo":"phacility/phabricator","slug":"this-push-was-rejected-by-custom-hook-script-s","errorCode":null,"errorMessage":"This push was rejected by custom hook script '%s':\n\n%s%s","messagePattern":"This push was rejected by custom hook script '(.+?)':\n\n(.+?)(.+?)","errorType":"exception","errorClass":"DiffusionCommitHookRejectException","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/engine/DiffusionCommitHookEngine.php","lineNumber":690,"sourceCode":"        // NOTE: We're explicitly running the hooks in sequential order to\n        // make this more predictable.\n        $future = id(new ExecFuture('%s %Ls', $hook, $args))\n          ->setEnv($env, $wipe_process_env = false)\n          ->write($stdin);\n\n        list($err, $stdout, $stderr) = $future->resolve();\n        if (!$err) {\n          // This hook ran OK, but echo its output in case there was something\n          // informative.\n          $console->writeOut('%s', $stdout);\n          $console->writeErr('%s', $stderr);\n          continue;\n        }\n\n        $this->rejectCode = PhabricatorRepositoryPushLog::REJECT_EXTERNAL;\n        $this->rejectDetails = basename($hook);\n\n        throw new DiffusionCommitHookRejectException(\n          pht(\n            \"This push was rejected by custom hook script '%s':\\n\\n%s%s\",\n            basename($hook),\n            $stdout,\n            $stderr));\n      }\n    }\n  }\n\n  private function getExecutablesInDirectory($directory) {\n    $executables = array();\n\n    if (!Filesystem::pathExists($directory)) {\n      return $executables;\n    }\n\n    foreach (Filesystem::listDirectory($directory) as $path) {\n      $full_path = $directory.DIRECTORY_SEPARATOR.$path;","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/engine/DiffusionCommitHookEngine.php#L672-L708","documentation":"Push rejection from applyCustomHooks: a repository-configured custom hook script exited nonzero. The message embeds the hook's name plus its combined stdout/stderr, and the failure aborts the push. This is Phabricator surfacing an external, user-defined pre-push check that failed.","triggerScenarios":"Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:690 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the hook's own output in the message for its failure reason","Fix the change to satisfy the custom hook's requirements","Have the repository owner fix or relax the custom hook script if it is over-strict"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}