{"record":{"id":"03a9f1f6f0b83111","repo":"phacility/phabricator","slug":"failed-to-fetch-remote-uri-s-after-following-s","errorCode":null,"errorMessage":"Failed to fetch remote URI \"%s\" after following %s redirect(s) (%s): %s","messagePattern":"Failed to fetch remote URI \"(.+?)\" after following (.+?) redirect\\(s\\) \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"PhutilProxyException","httpStatus":null,"severity":"error","filePath":"src/applications/files/storage/PhabricatorFile.php","lineNumber":682,"sourceCode":"        } else {\n          // This is HTTP 2XX, so use the response body to save the file data.\n          // Provide a default name based on the URI, truncating it if the URI\n          // is exceptionally long.\n\n          $default_name = basename($uri);\n          $default_name = id(new PhutilUTF8StringTruncator())\n            ->setMaximumBytes(64)\n            ->truncateString($default_name);\n\n          $params = $params + array(\n            'name' => $default_name,\n          );\n\n          return self::newFromFileData($body, $params);\n        }\n      } catch (Exception $ex) {\n        if ($redirects) {\n          throw new PhutilProxyException(\n            pht(\n              'Failed to fetch remote URI \"%s\" after following %s redirect(s) '.\n              '(%s): %s',\n              $uri,\n              phutil_count($redirects),\n              implode(' > ', array_keys($redirects)),\n              $ex->getMessage()),\n            $ex);\n        } else {\n          throw $ex;\n        }\n      }\n    }\n  }\n\n  public static function normalizeFileName($file_name) {\n    $pattern = \"@[\\\\x00-\\\\x19#%&+!~'\\$\\\"\\/=\\\\\\\\?<> ]+@\";\n    $file_name = preg_replace($pattern, '_', $file_name);","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/storage/PhabricatorFile.php#L664-L700","documentation":"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.","triggerScenarios":"Thrown at src/applications/files/storage/PhabricatorFile.php:682 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the embedded HTTP status text for the remote server's failure reason","Verify the URL is correct and the resource still exists","Ensure the remote host is reachable and not blocked by outbound HTTP policy"],"exampleFix":null,"handlingStrategy":"retry","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"}