{"record":{"id":"bef43fd994464cfb","repo":"phacility/phabricator","slug":"a-specified-server-at-index-s-on-port-s-h","errorCode":null,"errorMessage":"A specified server (at index \"%s\", on port \"%s\") has an invalid type (\"%s\"). Valid types are: admin, client.","messagePattern":"A specified server \\(at index \"(.+?)\", on port \"(.+?)\"\\) has an invalid type \\(\"(.+?)\"\\)\\. Valid types are: admin, client\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php","lineNumber":129,"sourceCode":"        throw new PhutilArgumentUsageException(\n          pht(\n            'Two servers (at indexes \"%s\" and \"%s\") both bind to the same '.\n            'port (\"%s\"). Each server must bind to a unique port.',\n            $port_map[$port],\n            $index,\n            $port));\n      }\n\n      $type = $server['type'];\n      switch ($type) {\n        case 'admin':\n          $has_admin = true;\n          break;\n        case 'client':\n          $has_client = true;\n          break;\n        default:\n          throw new PhutilArgumentUsageException(\n            pht(\n              'A specified server (at index \"%s\", on port \"%s\") has an '.\n              'invalid type (\"%s\"). Valid types are: admin, client.',\n              $index,\n              $port,\n              $type));\n      }\n\n      $ssl_key = idx($server, 'ssl.key');\n      $ssl_cert = idx($server, 'ssl.cert');\n      if (($ssl_key && !$ssl_cert) || ($ssl_cert && !$ssl_key)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'A specified server (at index \"%s\", on port \"%s\") specifies '.\n            'only one of \"%s\" and \"%s\". Each server must specify neither '.\n            '(to disable SSL) or specify both (to enable it).',\n            $index,\n            $port,","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php#L111-L147","documentation":"Thrown when a server entry in the Aphlict config 'servers' list has a 'type' value other than the two recognized strings 'admin' or 'client'. The switch statement over $server['type'] falls through to default and raises this PhutilArgumentUsageException, identifying the offending index and port.","triggerScenarios":"\"type\" is misspelled or wrong case (\"Client\", \"http\", \"ws\", \"notifications\"), null, or omitted-then-filled-from-a-template. Note PhutilTypeSpec only enforces 'type' as a string, so any string reaches this check.","commonSituations":"Copied config from an older Phabricator version or third-party tutorial using different type names; assumed the websocket type keyword from other pub/sub servers (e.g. \"ws\" or \"client-api\").","solutions":["Set each server's \"type\" to exactly \"client\" or \"admin\" (lowercase)","Remember the mapping: client = browser websocket notifications listener; admin = Phabricator web tier posts messages to it","Keep at least one of each type, otherwise errors 66-68 follow"],"exampleFix":"// before\n{\"type\": \"ws\", \"port\": 22280}\n// after\n{\"type\": \"client\", \"port\": 22280}","handlingStrategy":"validation","validationCode":"foreach ($config['servers'] as $server) {\n  $type = idx($server, 'type');\n  if (!in_array($type, array('admin', 'client'), true)) {\n    throw new InvalidArgumentException(\"Invalid server type: '{$type}'\");\n  }\n}","typeGuard":"function is_valid_aphlict_server_type($type) {\n  return is_string($type)\n    && in_array(strtolower($type), array('admin','client'), true);\n}","tryCatchPattern":null,"preventionTips":["Copy server entries from the stock conf example rather than retyping type strings","Treat any change to 'type' values as schema: only 'admin' and 'client' exist"],"tags":["aphlict","configuration","invalid-value","phabricator"],"backgroundTag":"invalid-config-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}