{"record":{"id":"ce523d2a047d242d","repo":"phacility/phabricator","slug":"something-is-wrong-source-of-a-copy-must-exist","errorCode":null,"errorMessage":"Something is wrong; source of a copy must exist.","messagePattern":"Something is wrong; source of a copy must exist\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php","lineNumber":203,"sourceCode":"            } else {\n              if (isset($deleted_paths[$copy_from])) {\n                $type = DifferentialChangeType::TYPE_MOVE_HERE;\n                $other_type = DifferentialChangeType::TYPE_MOVE_AWAY;\n              } else {\n                $type = DifferentialChangeType::TYPE_COPY_HERE;\n                $other_type = DifferentialChangeType::TYPE_COPY_AWAY;\n              }\n\n              $source_file_type = $this->lookupPathFileType(\n                $repository,\n                $copy_from,\n                array(\n                  'rawPath'   => $copy_from,\n                  'rawCommit' => $copy_rev,\n                ));\n\n              if ($source_file_type == DifferentialChangeType::FILE_DELETED) {\n                throw new Exception(\n                  pht('Something is wrong; source of a copy must exist.'));\n              }\n\n              if ($source_file_type != DifferentialChangeType::FILE_DIRECTORY) {\n                if (isset($raw_paths[$copy_from]) ||\n                    isset($effects[$copy_from])) {\n                  break;\n                }\n                $effects[$copy_from] = array(\n                  'rawPath'           => $copy_from,\n                  'rawTargetPath'     => null,\n                  'rawTargetCommit'   => null,\n                  'rawDirect'         => false,\n\n                  'changeType'        => $other_type,\n                  'fileType'          => $source_file_type,\n                );\n              } else {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php#L185-L221","documentation":"While parsing an SVN commit, a copy operation's source path was looked up at the copy revision and came back as DELETED, which contradicts SVN semantics: a copy source must exist at its revision (PhabricatorRepositorySvnCommitChangeParserWorker.php:193-206). Phabricator treats this as an integrity error in the SVN history or in the lookup layer.","triggerScenarios":"SVN repositories whose history was filtered or rewritten (svndumpfilter) so a copy references a path that no longer exists at the copy revision; lookups against a partial or desynchronized mirror; genuinely corrupted SVN repositories.","commonSituations":"SVN repos split or filtered before import, creating dangling copy sources; partial mirrors missing historic revisions; repository surgery artifacts.","solutions":["Verify the source exists: svn ls -r <copy_rev> <repo-url>/<copy_from> - if missing, the history itself is broken","Re-import from an unfiltered dump, or configure subdirectory import (svn-subpath) so foreign sources become stub commits","If the source verifiably exists in SVN, report it upstream as a parser bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before importing, verify copy sources exist in the SVN history:\n//   svn log -v <repo-url> | grep '   A /path (from ...)'  # then check each source\n//   svn ls -r <copy_rev> <repo-url>/<copy_from>","typeGuard":null,"tryCatchPattern":"try {\n  $changes = $this->parseSVNCommit($repository, $commit);\n} catch (Exception $ex) {\n  // Copy source reported deleted: history integrity problem. Verify with\n  // 'svn ls -r <rev> <path>'; fix the history or switch to subdirectory\n  // import rather than retrying.\n  phlog($ex);\n  throw $ex;\n}","preventionTips":["Do not import svndumpfilter-ed SVN repos with dangling copy sources; re-export unfiltered","Keep SVN mirrors complete rather than partial","Verify copy integrity (svnadmin verify, copyfrom-rev checks) before import"],"tags":["phabricator","svn","parsing","repository-corruption","copy-history","php"],"backgroundTag":"vcs-history-inconsistency","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}