{"record":{"id":"2dd46f3877b01276","repo":"phacility/phabricator","slug":"storage-patch-s-specifies-a-phase-value-s","errorCode":null,"errorMessage":"Storage patch \"%s\" specifies a \"@phase\" value (\"%s\"), but this is not a recognized phase. Valid phases are: %s.","messagePattern":"Storage patch \"(.+?)\" specifies a \"@phase\" value \\(\"(.+?)\"\\), but this is not a recognized phase\\. Valid phases are: (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/patch/PhabricatorSQLPatchList.php","lineNumber":301,"sourceCode":"        if (preg_match('(^\\s*//\\s*@(\\S+)(?:\\s+(.*))?\\z)', $line, $matches)) {\n          $attr_key = $matches[1];\n          $attr_value = trim(idx($matches, 2));\n\n          switch ($attr_key) {\n            case 'phase':\n              $phase_name = $attr_value;\n\n              if (!strlen($phase_name)) {\n                throw new Exception(\n                  pht(\n                    'Storage patch \"%s\" specifies a \"@phase\" attribute with '.\n                    'no phase value. Phase attributes must specify a value, '.\n                    'like \"@phase default\".',\n                    $patch_name));\n              }\n\n              if (!isset($phase_map[$phase_name])) {\n                throw new Exception(\n                  pht(\n                    'Storage patch \"%s\" specifies a \"@phase\" value (\"%s\"), '.\n                    'but this is not a recognized phase. Valid phases '.\n                    'are: %s.',\n                    $patch_name,\n                    $phase_name,\n                    implode(', ', $phase_list)));\n              }\n\n              if (isset($attributes['phase'])) {\n                throw new Exception(\n                  pht(\n                    'Storage patch \"%s\" specifies a \"@phase\" value (\"%s\"), '.\n                    'but it already has a specified phase (\"%s\"). Patches '.\n                    'may not specify multiple phases.',\n                    $patch_name,\n                    $phase_name,\n                    $attributes['phase']));","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/patch/PhabricatorSQLPatchList.php#L283-L319","documentation":"The '@phase' attribute in a PHP patch's header comment must name a recognized phase from PhabricatorStoragePatch::getPhaseList() (currently 'default' and 'worker'). An unrecognized value means ordering cannot be validated, so the loader rejects the patch file.","triggerScenarios":"A patch file header says '// @phase setup', '// @phase daemon', '// @phase Default', or any value other than exactly 'default' or 'worker'. Case and whitespace matter — the value is matched literally against the phase map.","commonSituations":"Guessing phase names; copying an annotation from a different Phabricator version whose phase list differed; capitalization or trailing-punctuation typos.","solutions":["Change the value to 'default' or 'worker' as listed in the error message.","If you did not mean to phase the patch, remove the '@phase' line.","Re-run 'bin/storage status' to confirm the file parses."],"exampleFix":"// before (top of patch file)\n// @phase daemon\n\n// after\n// @phase worker","handlingStrategy":"validation","validationCode":"$valid = array_fuse(PhabricatorStoragePatch::getPhaseList());\n// before writing '// @phase X' in a patch header:\nif (!isset($valid['worker'])) { /* pick from: ' . implode(', ', array_keys($valid)) . ') */ }\n// i.e. only ever write '// @phase default' or '// @phase worker'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy a working '@phase worker' line from an existing patch rather than typing the literal.","Treat the phase list as fixed ('default', 'worker'); do not invent phases."],"tags":["phabricator","database-migration","phases","file-header"],"backgroundTag":"database-migration-validation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}