hashi-ui icon indicating copy to clipboard operation
hashi-ui copied to clipboard

Attempt to deregister remote service doesn't escape IPv6

Open odysseus654 opened this issue 6 years ago • 2 comments

Attempting to force-deregister a service from the "Nodes" pane results in an error similar to the following:

ERRO [18395] connection: unable to run /consul/service/deregister?node=2604:1ff4:e22c:1552:c782:f675:ca53:52f4&service=rabbitmq:ip-10-2-20-162:unable to deregister consul service 'rabbitmq:ip-10-2-20-162': Put http://2604:1ff4:e22c:1552:c782:f675:ca53:52f4:8500/v1/agent/service/deregister/rabbitmq:ip-10-2-20-162: invalid URL port "1ff4:e22c:1552:c782:f675:ca53:52f4:8500" connection_id=1a1af6d4

This is referencing the following URL: http://2604:1ff4:e22c:1552:c782:f675:ca53:52f4:8500/v1/agent/service/deregister/rabbitmq:ip-10-2-20-162

The correct URL in this instance is: http://[2604:1ff4:e22c:1552:c782:f675:ca53:52f4]:8500/v1/agent/service/deregister/rabbitmq:ip-10-2-20-162

(P.S. The action wasn't going to be possible anyhow as the server is bound to 127.0.0.1:8500)

odysseus654 avatar Sep 23 '17 01:09 odysseus654

so it's missing [] around the IP?

jippi avatar Oct 19 '17 20:10 jippi

My understanding is that it is, from experience in other projects as well as a quick search discovering RFC 2732 . My web browser will refuse to parse the url without the brackets.

I do note it a bit strange that GitHub doesn't url-ify the version that contains brackets though.

odysseus654 avatar Oct 19 '17 20:10 odysseus654