phacility/phabricator · error · PhutilArgumentUsageException
A specified server (at index "%s", on port "%s") has an inva
Error message
A specified server (at index "%s", on port "%s") has an invalid type ("%s"). Valid types are: admin, client. What it means
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.
Source
Thrown at src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:129
throw new PhutilArgumentUsageException(
pht(
'Two servers (at indexes "%s" and "%s") both bind to the same '.
'port ("%s"). Each server must bind to a unique port.',
$port_map[$port],
$index,
$port));
}
$type = $server['type'];
switch ($type) {
case 'admin':
$has_admin = true;
break;
case 'client':
$has_client = true;
break;
default:
throw new PhutilArgumentUsageException(
pht(
'A specified server (at index "%s", on port "%s") has an '.
'invalid type ("%s"). Valid types are: admin, client.',
$index,
$port,
$type));
}
$ssl_key = idx($server, 'ssl.key');
$ssl_cert = idx($server, 'ssl.cert');
if (($ssl_key && !$ssl_cert) || ($ssl_cert && !$ssl_key)) {
throw new PhutilArgumentUsageException(
pht(
'A specified server (at index "%s", on port "%s") specifies '.
'only one of "%s" and "%s". Each server must specify neither '.
'(to disable SSL) or specify both (to enable it).',
$index,
$port,View on GitHub (pinned to 5720a38cfe)
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
Example fix
// before
{"type": "ws", "port": 22280}
// after
{"type": "client", "port": 22280} Defensive patterns
Strategy: validation
Validate before calling
foreach ($config['servers'] as $server) {
$type = idx($server, 'type');
if (!in_array($type, array('admin', 'client'), true)) {
throw new InvalidArgumentException("Invalid server type: '{$type}'");
}
} Type guard
function is_valid_aphlict_server_type($type) {
return is_string($type)
&& in_array(strtolower($type), array('admin','client'), true);
} Prevention
- 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
When it happens
Trigger: "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.
Common situations: 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").
Related errors
- Configuration file is not properly formatted JSON. %s
- Configuration file has improper configuration keys at top le
- Two servers (at indexes "%s" and "%s") both bind to the same
- A specified server (at index "%s", on port "%s") specifies o
- A specified server (at index "%s", on port "%s") specifies a
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/bef43fd994464cfb.
Report an issue: GitHub.