phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

Associated hook ("%s") for webhook request ("%s") has invali

Error message

Associated hook ("%s") for webhook request ("%s") has invalid fetch URI: %s

What it means

The hook's URI must pass PhabricatorEnv::requireValidRemoteURIForFetch(): protocol must be http or https, the domain must be present and DNS-resolvable, and no resolved address may sit on the outbound blacklist (loopback, link-local, and other internal ranges) unless allowlisted. On failure the request is marked ERROR_URI and the task permanently fails, embedding the underlying reason from the caught exception.

Source

Thrown at src/applications/herald/worker/HeraldWebhookWorker.php:72

          'Associated hook ("%s") for webhook request ("%s") is disabled.',
          $hook->getPHID(),
          $request_phid));
    }

    $uri = $hook->getWebhookURI();
    try {
      PhabricatorEnv::requireValidRemoteURIForFetch(
        $uri,
        array(
          'http',
          'https',
        ));
    } catch (Exception $ex) {
      $this->failRequest(
        $request,
        HeraldWebhookRequest::ERRORTYPE_HOOK,
        HeraldWebhookRequest::ERROR_URI);
      throw new PhabricatorWorkerPermanentFailureException(
        pht(
          'Associated hook ("%s") for webhook request ("%s") has invalid '.
          'fetch URI: %s',
          $hook->getPHID(),
          $request_phid,
          $ex->getMessage()));
    }

    $object_phid = $request->getObjectPHID();

    $object = id(new PhabricatorObjectQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($object_phid))
      ->executeOne();
    if (!$object) {
      $this->failRequest(
        $request,
        HeraldWebhookRequest::ERRORTYPE_HOOK,

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Read the embedded reason (%s from the exception) -- it names the exact failed check (protocol, unresolvable domain, or blacklisted address).
  2. Point the hook at a resolvable, non-blacklisted https endpoint reachable from the Phabricator host.
  3. If the target must be an internal address, allowlist the exact URI by setting 'phabricator.allowed-uris' (checked inside requireValidRemoteURIForFetch) and re-test.
  4. Fix DNS resolution on the Phabricator host if the domain fails to resolve there.
Defensive patterns

Strategy: validation

Validate before calling

// Validate the hook URI exactly as the worker will, before saving/queueing:
try {
  PhabricatorEnv::requireValidRemoteURIForFetch(
    $uri,
    array('http', 'https'));
} catch (Exception $ex) {
  $errors[] = $ex->getMessage(); // show to the admin at edit time
}

Prevention

When it happens

Trigger: Webhook URI set to something like http://localhost:9000/hooks, https://10.0.0.5/hook, a domain that resolves to 127.0.0.1, or a non-http(s) scheme; DNS for the target domain not resolvable from the Phabricator host.

Common situations: Pointing webhooks at internal/dev endpoints on the same network or host (blocked as SSRF protection); containerized installs where DNS differs from the operator's machine; scheme typos like 'htt://' or 'ftp://'.

Related errors


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