Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use IPv6 address in Alertmanager URL #2025

Closed
thedirtycolumbia opened this Issue Sep 23, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@thedirtycolumbia
Copy link

thedirtycolumbia commented Sep 23, 2016

What did you do?
Tried to set -alertmanager.url=http://[IPV6ADDRESS]:PORT/

What did you expect to see?
Prometheus able to send alerts to an IPv6 Alertmanager.

What did you see instead? Under which circumstances?
It appears that govalidator.IsURL does not properly handle IPv6 address (w/ or w/o brackets).

Environment

time="2016-09-23T00:08:32Z" level=error msg="invalid Alertmanager URL: http://[::1]:9093" source="main.go:65"
@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Sep 23, 2016

@thedirtycolumbia Thanks! Hmm, govalidator has bitten us a number of times already now. I wonder if we should keep using it or just let the occasional wrong URL through.

For now I filed a bug there: asaskevich/govalidator#150

The fix doesn't seem totally trivial if one wanted to fix the rxURL regex there. Regexing IPv6 correctly apparently gets quite long. Maybe the correct solution there is to restructure the code and move away from a URL regex altogether.

@thedirtycolumbia

This comment has been minimized.

Copy link
Author

thedirtycolumbia commented Sep 23, 2016

@juliusv Thanks for the quick response and the bug filed upstream! I have subscribed to that issue as well. It may be that moving away from the URL regex is a good solution if it is a recurring problem. We'll keep an eye on how things go in asaskevich/govalidator#150.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Sep 25, 2016

@thedirtycolumbia Yeah, sorry about that. The workaround for now would be to use a DNS name (or even just an /etc/hosts entry) that resolves only to a v6 address. Still, we should fix this soon ourselves if govalidator doesn't do so.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Oct 26, 2016

Looks like we just need to update our vendoring now.

@thedirtycolumbia

This comment has been minimized.

Copy link
Author

thedirtycolumbia commented Oct 26, 2016

@brian-brazil Thanks! We're looking forward to this fix.

brancz added a commit to brancz/prometheus that referenced this issue Oct 27, 2016

brian-brazil added a commit that referenced this issue Oct 27, 2016

beorn7 added a commit that referenced this issue Oct 28, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.