phacility/phabricator · error · Exception

The URI "%s" does not correspond to a valid image file (got

Error message

The URI "%s" does not correspond to a valid image file (got a file with MIME type "%s"). You must specify the URI of a valid image file.

What it means

Error "The URI "%s" does not correspond to a valid image file (got a file with MIME type "%s"). You must specify the URI of a valid image file." thrown in phacility/phabricator.

Source

Thrown at src/applications/files/controller/PhabricatorFileImageProxyController.php:67

      // scanning networks and ports.
      PhabricatorSystemActionEngine::willTakeAction(
        array($viewer->getPHID()),
        new PhabricatorFilesOutboundRequestAction(),
        1);

      $file = PhabricatorFile::newFromFileDownload(
        $uri,
        array(
          'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
          'canCDN' => true,
        ));

      if (!$file->isViewableImage()) {
        $mime_type = $file->getMimeType();
        $engine = new PhabricatorDestructionEngine();
        $engine->destroyObject($file);
        $file = null;
        throw new Exception(
          pht(
            'The URI "%s" does not correspond to a valid image file (got '.
            'a file with MIME type "%s"). You must specify the URI of a '.
            'valid image file.',
            $uri,
            $mime_type));
      }

      $file->save();

      $external_request
        ->setIsSuccessful(1)
        ->setFilePHID($file->getPHID());

      $save_request = true;
    } catch (HTTPFutureHTTPResponseStatus $status) {
      $external_request
        ->setIsSuccessful(0)

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/files/controller/PhabricatorFileImageProxyController.php:67 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/de0817b9b55d0529. Report an issue: GitHub.