{"record":{"id":"5e05fbe9d715bf88","repo":"phacility/phabricator","slug":"unsupported-character-set-s","errorCode":null,"errorMessage":"Unsupported character set \"%s\".","messagePattern":"Unsupported character set \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php","lineNumber":371,"sourceCode":"                if ($auto) {\n                  $parts[] = qsprintf(\n                    $conn,\n                    'AUTO_INCREMENT');\n                }\n\n                if ($adjust['charset']) {\n                  switch ($adjust['charset']) {\n                    case 'binary':\n                      $charset_value = qsprintf($conn, 'binary');\n                      break;\n                    case 'utf8':\n                      $charset_value = qsprintf($conn, 'utf8');\n                      break;\n                    case 'utf8mb4':\n                      $charset_value = qsprintf($conn, 'utf8mb4');\n                      break;\n                    default:\n                      throw new Exception(\n                        pht(\n                          '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;","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php#L353-L389","documentation":"During the schema-adjustment phase of `bin/storage upgrade`, an adjustment for a column carries a charset other than binary, utf8 or utf8mb4 — the only values this switch can render into `ALTER ... CHARACTER SET`. The exception means the code that computes expected schema and the code that applies adjustments disagree, which in practice indicates local modifications or a mixed-version tree.","triggerScenarios":"An adjustment record with an unrecognized charset reaches the switch: a fork extending schema specs with a new charset without extending this switch, or storage-management code and schema-spec code from different Phabricator versions (for example stale opcache after a partial deploy).","commonSituations":"Running bin/storage from one version of the tree against patched or half-updated code; forks adding charset handling; opcache serving an old workflow file after a pull.","solutions":["Restore one coherent code version: verify `git status`, redeploy cleanly, restart PHP so opcache reloads.","Remove local schema-spec changes that introduce charsets outside binary/utf8/utf8mb4, or update the specs to use supported values.","If you maintain a fork that genuinely needs the charset, extend the switch in PhabricatorStorageManagementWorkflow in the same change as the spec."],"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 so opcache cannot serve mixed versions.","Keep schema-spec changes and the storage workflow switch in the same commit.","Treat this exception as a code defect signal, not an environment fault."],"tags":["phabricator","bin-storage","schema-adjust","charset","code-version-mismatch"],"backgroundTag":"unsupported-charset","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}