{"record":{"id":"527f7f3c9f1600d7","repo":"phacility/phabricator","slug":"unknown-svn-file-kind-s","errorCode":null,"errorMessage":"Unknown SVN file kind '%s'.","messagePattern":"Unknown SVN file kind '(.+?)'\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php","lineNumber":635,"sourceCode":"      }\n    }\n\n    foreach ($paths as $path => $lookup) {\n      if (empty($result_map[$path])) {\n        $result_map[$path] = DifferentialChangeType::FILE_DELETED;\n      }\n    }\n\n    return $result_map;\n  }\n\n  private function getFileTypeFromSVNKind($kind) {\n    $kind = (string)$kind;\n    switch ($kind) {\n      case 'dir':   return DifferentialChangeType::FILE_DIRECTORY;\n      case 'file':  return DifferentialChangeType::FILE_NORMAL;\n      default:\n        throw new Exception(pht(\"Unknown SVN file kind '%s'.\", $kind));\n    }\n  }\n\n  private function lookupRecursiveFileList(\n    PhabricatorRepository $repository,\n    array $info) {\n\n    $path = $info['rawPath'];\n    $rev  = $info['rawCommit'];\n\n    $path_uri = $repository->getSubversionPathURI($path, $rev);\n    $hashkey = md5($path_uri);\n\n    // This method is quite horrible. The underlying challenge is that some\n    // commits in the Facebook repository are enormous, taking multiple hours\n    // to 'ls -R' out of the repository and producing XML files >1GB in size.\n\n    // If we try to SimpleXML them, the object exhausts available memory on a","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php#L617-L653","documentation":"getFileTypeFromSVNKind() maps the kind attribute of svn ls --xml entries to FILE_DIRECTORY ('dir') or FILE_NORMAL ('file'); any other kind string throws (PhabricatorRepositorySvnCommitChangeParserWorker.php:632-638). On the visible call path the value is constrained by the entry regex to (file|dir), so this is largely a defensive check against future SVN output changes or other call sites.","triggerScenarios":"An svn client or server emitting a new node-kind value in the XML; other code paths passing an unexpected kind string; whitespace/encoding noise making the captured group differ from 'file'/'dir'.","commonSituations":"Upgrading the svn binary on the Phabricator host to a version with changed output; unusual SVN server implementations or gateways.","solutions":["Reproduce: run svn ls --xml on the failing path and inspect the kind attribute","Pin the svn client to a version whose output matches the parser's expectations","Patch the parser locally to handle the new kind and report it upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Confirm the svn client emits only known kinds (pre-flight in dev):\n//   svn ls --xml <repo-url> | grep -o 'kind=\"[^\"]*\"' | sort -u\n// Expect exactly kind=\"file\" and kind=\"dir\".","typeGuard":"function isKnownSvnKind($kind) {\n  return in_array((string)$kind, array('dir', 'file'), true);\n}","tryCatchPattern":"try {\n  $type = $this->getFileTypeFromSVNKind($kind);\n} catch (Exception $ex) {\n  // Unknown node kind from svn ls --xml: pin/change the svn client or\n  // patch the parser; log the raw kind for diagnosis.\n  phlog(pht('Unknown SVN kind: %s', $kind));\n  throw $ex;\n}","preventionTips":["Pin the svn client version on Phabricator hosts and check its XML output after upgrades","Run svnadmin/svn smoke tests in staging before production upgrades","Report new node kinds upstream so the parser learns them"],"tags":["phabricator","svn","xml","parsing","version-compatibility","php"],"backgroundTag":"vcs-output-parse-failure","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}