{"record":{"id":"6a8fd3d3e8c8df89","repo":"phacility/phabricator","slug":"s-s-has-a-patch-with-a-colon-in-the-key-name","errorCode":null,"errorMessage":"%s '%s' has a patch with a colon in the key name, '%s'. Patch keys may not contain colons.","messagePattern":"(.+?) '(.+?)' has a patch with a colon in the key name, '(.+?)'\\. Patch keys may not contain colons\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/patch/PhabricatorSQLPatchList.php","lineNumber":112,"sourceCode":"                get_class($patch_list),\n                $key,\n                $pkey,\n                implode(', ', array_keys($valid))));\n          }\n        }\n\n        if (is_numeric($key)) {\n          throw new Exception(\n            pht(\n              \"%s '%s' has a patch with a numeric key, '%s'. \".\n              \"Patches must use string keys.\",\n              __CLASS__,\n              get_class($patch_list),\n              $key));\n        }\n\n        if (strpos($key, ':') !== false) {\n          throw new Exception(\n            pht(\n              \"%s '%s' has a patch with a colon in the key name, '%s'. \".\n              \"Patch keys may not contain colons.\",\n              __CLASS__,\n              get_class($patch_list),\n              $key));\n        }\n\n        $namespace = $patch_list->getNamespace();\n        $full_key = \"{$namespace}:{$key}\";\n\n        if (isset($specs[$full_key])) {\n          throw new Exception(\n            pht(\n              \"%s '%s' has a patch '%s' which duplicates an \".\n              \"existing patch key.\",\n              __CLASS__,\n              get_class($patch_list),","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php#L94-L130","documentation":"Patch keys may not contain ':' because Phabricator composes globally unique full keys as \"namespace:key\" (see the $full_key assignment right after this check). A colon inside a patch key would corrupt that namespacing and make applied-patch tracking ambiguous, so the loader rejects it immediately.","triggerScenarios":"A patch key in getPatches() contains a colon — e.g. copying a full key like 'phabricator:20180101.foo.sql' from storage logs or 'bin/storage status' output and pasting it as the array key in a patch list (it must be the bare '20180101.foo.sql' inside its own namespace).","commonSituations":"Copying a fully-qualified patch name from error output, migration logs, or the patch_status database table back into a patch definition; writing dependencies in 'after' as keys in your own list by mistake.","solutions":["Strip the namespace prefix and colon from the key, leaving only the bare patch name.","Confirm getNamespace() for the class supplies the prefix automatically.","Re-run 'bin/storage status' to confirm the list loads."],"exampleFix":"// before\n'phabricator:20180101.widget.sql' => array(\n  'type' => 'sql',\n  'name' => $this->getPatchPath('20180101.widget.sql'),\n),\n\n// after\n'20180101.widget.sql' => array(\n  'type' => 'sql',\n  'name' => $this->getPatchPath('20180101.widget.sql'),\n),","handlingStrategy":"validation","validationCode":"// Reject colons before the storage layer does:\nforeach ((new MyApplicationPatchList())->getPatches() as $key => $spec) {\n  if (strpos($key, ':') !== false) {\n    throw new Exception(\"Patch keys must not contain ':': {$key}\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Paste only bare patch names (no 'namespace:' prefix) into array keys; the prefix is added automatically.","Never copy a full key from patch_status tables or log output directly into a patch definition."],"tags":["phabricator","database-migration","namespacing","php"],"backgroundTag":"database-migration-validation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}