phacility/phabricator · error · PhutilProxyException

Failed to fetch remote URI

Error message

Failed to fetch remote URI "%s" after following %s redirect(s) (%s): %s

What it means

Terminal fetch failure in newFromFileDownload: after manually following the recorded redirect chain, the last HTTP request returned an error status and no more redirects remained, so the remote file body could not be retrieved.

Solutions

  1. Check the embedded HTTP status text for the remote server's failure reason
  2. Verify the URL is correct and the resource still exists
  3. Ensure the remote host is reachable and not blocked by outbound HTTP policy
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/applications/files/storage/PhabricatorFile.php:682 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/03a9f1f6f0b83111. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/files/storage/PhabricatorFile.php:682

        } else {
          // This is HTTP 2XX, so use the response body to save the file data.
          // Provide a default name based on the URI, truncating it if the URI
          // is exceptionally long.

          $default_name = basename($uri);
          $default_name = id(new PhutilUTF8StringTruncator())
            ->setMaximumBytes(64)
            ->truncateString($default_name);

          $params = $params + array(
            'name' => $default_name,
          );

          return self::newFromFileData($body, $params);
        }
      } catch (Exception $ex) {
        if ($redirects) {
          throw new PhutilProxyException(
            pht(
              'Failed to fetch remote URI "%s" after following %s redirect(s) '.
              '(%s): %s',
              $uri,
              phutil_count($redirects),
              implode(' > ', array_keys($redirects)),
              $ex->getMessage()),
            $ex);
        } else {
          throw $ex;
        }
      }
    }
  }

  public static function normalizeFileName($file_name) {
    $pattern = "@[\\x00-\\x19#%&+!~'\$\"\/=\\\\?<> ]+@";
    $file_name = preg_replace($pattern, '_', $file_name);

View on GitHub (pinned to 5720a38cfe)