{"record":{"id":"f331d7496442ff73","repo":"phacility/phabricator","slug":"unsupported-collation-set-s","errorCode":null,"errorMessage":"Unsupported collation set \"%s\".","messagePattern":"Unsupported collation set \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php","lineNumber":391,"sourceCode":"                          'Unsupported character set \"%s\".',\n                          $adjust['charset']));\n                  }\n\n                  switch ($adjust['collation']) {\n                    case 'binary':\n                      $collation_value = qsprintf($conn, 'binary');\n                      break;\n                    case 'utf8_general_ci':\n                      $collation_value = qsprintf($conn, 'utf8_general_ci');\n                      break;\n                    case 'utf8mb4_bin':\n                      $collation_value = qsprintf($conn, 'utf8mb4_bin');\n                      break;\n                    case 'utf8mb4_unicode_ci':\n                      $collation_value = qsprintf($conn, 'utf8mb4_unicode_ci');\n                      break;\n                    default:\n                      throw new Exception(\n                        pht(\n                          'Unsupported collation set \"%s\".',\n                          $adjust['collation']));\n                  }\n\n                  $parts[] = qsprintf(\n                    $conn,\n                    'CHARACTER SET %Q COLLATE %Q',\n                    $charset_value,\n                    $collation_value);\n                }\n\n                if ($parts) {\n                  $parts = qsprintf($conn, '%LJ', $parts);\n                } else {\n                  $parts = qsprintf($conn, '');\n                }\n","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php#L373-L409","documentation":"During the schema-adjustment phase of `bin/storage upgrade`, a column adjustment carries a collation other than binary, utf8_general_ci, utf8mb4_bin or utf8mb4_unicode_ci — the only values the workflow can render into `COLLATE`. The exception signals that schema-expectation code and the adjustment applier disagree, which in practice means local modifications or a mixed-version tree.","triggerScenarios":"An adjustment record with an unrecognized collation reaches the switch: fork-modified schema specs, or storage-management code and schema-spec code from different versions (stale opcache, partial deploy).","commonSituations":"Half-updated checkouts where the workflow file is older than the spec code; forks backporting utf8mb4 work; opcache serving mixed file versions.","solutions":["Restore one coherent code version (clean checkout, redeploy, restart PHP to clear opcache) and re-run `./bin/storage upgrade`.","Remove local schema-spec changes that produce collations outside the supported set.","If the fork needs the collation, extend the switch together with the spec change in the same commit."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // bin/storage upgrade including the adjust phase\n} catch (Exception $ex) {\n  // adjustment invariant broke; do not retry until code versions are coherent\n  fwrite(STDERR, $ex->getMessage().\"\\n\");\n  exit(1);\n}","preventionTips":["Deploy the whole tree atomically and restart PHP after pulls.","Keep collation expectations limited to the supported set unless you also patch the switch.","Re-run ./bin/storage upgrade only after restoring one coherent version."],"tags":["phabricator","bin-storage","schema-adjust","collation","code-version-mismatch"],"backgroundTag":"unsupported-collation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}