Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrometheus cannot start if local host name contains whitespace #4773
Comments
This comment has been minimized.
This comment has been minimized.
|
Per RFCs 1123 2.2.1 and RFC 952 1 which it references, it is not valid to have spaces in a hostname. This is a bug in your OS that it permits you to set an invalid hostname. |
This comment has been minimized.
This comment has been minimized.
|
Try reading RFC 761 sometime; it might adjust your attitude. In principle and in the letter of the RFC you cite (which itself may have a bug), that may be true, but for very nearly 40 years, Postel's Law as stated in RFC 761 has encouraged us to "be conservative in what you do; be liberal in what you accept". By that standard, this is most definitely a defect, since it invalidates a large number of otherwise perfectly-functional development systems. But then again, as someone who first got into Linux when version 1.0 of the kernel was new and shiny (circa 1994) and ran a business on Linux for more than ten years, the high-and-mighty users-are-always-wrong attitude is why the "Year of the Linux Desktop" was always 5-10 years in the future, until it was clearly a decade or more in an alternate past. It really depends on what you think Prometheus is supposed to be. If it's a toy or a hobby, carry on; but to be taken seriously as a tool in the real world outside the Linux-geek echo chamber, adjustments are necessary. |
This comment has been minimized.
This comment has been minimized.
|
Prometheus needs a valid external URL to work, and the usual default isn't working due to the invalid hostname. I'd suggest trying setting --web.external-url manually. |
This comment has been minimized.
This comment has been minimized.
|
Ah. Thanks; that helps. I'll poke at that, then |
jdickey commentedOct 23, 2018
Proposal
It's fairly common on Macs (at least) to have spaces embedded in the host name. During system setup, mine got set as "Jeff's iMac", for example; I've seen this on many other Macs with many other people over the years. I would expect that a significant number of your candidate users are on Macs, at least for development; therefore, as things now stand, they cannot even run the Getting Started tutorial.
I believe it's unreasonable to expect people to change hostnames on systems they've been using, often for years, for the convenience of one software system, no matter how potentially useful.
Use case. Why is this important?
“Nice to have” is not a good use case. :)
Nowhere that I saw on the main Prometheus Web page does it indicate that Macs are not supported; indeed, your Download page includes tarballs for Darwin (Mac), Linux, and Windows. In the absence of documentation indicating otherwise, a reasonable user would expect the basic function of the system to be identical across all three systems. It clearly is not, which is mind-boggling for such an apparently mature package.
Bug Report
What did you do?
As laid out in the Getting Started tutorial, I created (and copied) the example
prometheus.ymlfile, and then ranWhat did you expect to see?
I expected that the Prometheus server would start accepting connections on http://localhost:9090 as described in the tutorial.
What did you see instead? Under which circumstances?
The error message quoted above:
parse external URL "": parse http://Jeff's iMac:9090/: invalid character " " in host nameEnvironment
System information:
insert output of
uname -srmhereDarwin 17.7.0 x86_64Prometheus version:
insert output of
prometheus --versionhereAlertmanager version:
insert output of
alertmanager --versionhere (if relevant to the issue)Prometheus configuration file:
Not known.
No logs separate from error output quoted above found on system.