{"record":{"id":"03231794fce57c23","repo":"phacility/phabricator","slug":"unknown-schema-adjustment-kind-s","errorCode":null,"errorMessage":"Unknown schema adjustment kind \"%s\"!","messagePattern":"Unknown schema adjustment kind \"(.+?)\"!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php","lineNumber":479,"sourceCode":"                  } else {\n                    $key_name = qsprintf(\n                      $conn,\n                      '/* NONUNIQUE */ KEY %T',\n                      $adjust['name']);\n                  }\n                }\n\n                queryfx(\n                  $conn,\n                  'ALTER TABLE %T.%T ADD %Q (%LK)',\n                  $adjust['database'],\n                  $adjust['table'],\n                  $key_name,\n                  $adjust['columns']);\n              }\n              break;\n            default:\n              throw new Exception(\n                pht('Unknown schema adjustment kind \"%s\"!', $adjust['kind']));\n          }\n        } catch (AphrontQueryException $ex) {\n          $failed[] = array($adjust, $ex);\n        }\n        $bar->update(1);\n      }\n    }\n    $bar->done();\n\n    if (!$failed) {\n      $console->writeOut(\n        \"%s\\n\",\n        pht('Completed applying all schema adjustments.'));\n\n      $err = 0;\n    } else {\n      $table = id(new PhutilConsoleTable())","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php#L461-L497","documentation":"The adjust loop hit an adjustment whose `kind` is not one of the handled cases (database, table, column, key). The kind list is produced by the same tree's schema-expectation code, so an unknown value means the running code disagrees with itself: a version mismatch, a partially deployed tree, or a fork that added a kind without a handler.","triggerScenarios":"An adjustment record with an unrecognized `kind` reaches the default case of the switch — mixed-version code after a partial deploy, stale opcache, or fork modifications to schema expectations that introduce a new adjustment kind.","commonSituations":"Deploying half an upgrade (management tool updated, specs not); long-running PHP processes serving cached old code; forks backporting adjustment kinds without the applier.","solutions":["Restore a single coherent version of the tree (clean checkout, redeploy, restart PHP to clear opcache) and re-run `./bin/storage upgrade`.","Audit local changes for a new adjustment kind lacking a handler; add the handler or drop the change.","Re-run the upgrade afterwards — adjustments are recomputed from scratch on every run."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // bin/storage upgrade including the adjust phase\n} catch (Exception $ex) {\n  // unknown adjustment kind; halt and reconcile code versions before retrying\n  fwrite(STDERR, $ex->getMessage().\"\\n\");\n  exit(1);\n}","preventionTips":["Deploy atomically; restart PHP (clear opcache) after every code update.","Never mix adjustment producers and the storage workflow across versions.","Log adjustment failures verbatim; the kind value identifies which side is stale."],"tags":["phabricator","bin-storage","schema-adjust","code-version-mismatch","enum"],"backgroundTag":"unknown-enum-switch-case","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}