Page MenuHomePhabricator

Cryptic error message when running `arc install certificate`
Closed, ResolvedPublic


A developer ran arc install certificate instead of arc install-certificate and the error message was very confusing:

> arc install certificate
Trying to connect to server...
Conduit URI '/api/' must include a valid host.
(Run with `--trace` for a full exception trace.)

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

Here's what's happening, in detail:

We accept any unique prefix of a command as that command, so arc install-cer is the same as arc install-certificate, so long as there are is no arc install-ceramics or similar. If there are, we list alternatives:

$ arc l
Usage Exception: Unknown command 'l'. Try 'arc help'.

Did you mean:

There are no other commands which begin with install, so arc install is equivalent to arc install-certificate. Expanded, this gives us:

$ arc install-certificate certificate

The argument is treated as a server URL, so it's correct for it to fail, but we're mangling it badly by the time it gets to an error message. The /api/ stuff gets added on later, largely for historical reasons.