APIHostPorts returns 'localhost' and '127.0.0.1'

Bug #1310258 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Martin Packman

Bug Description

My ~/.juju/environments/$ENV.jenv currently has this list of possible API server addresses:
- 54.216.90.129:17070
- ec2-54-216-90-129.eu-west-1.compute.amazonaws.com:17070
- ip-10-72-129-222.eu-west-1.compute.internal:17070
- 10.72.129.222:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80::2000:aff:fe48:81de]:17070'
- ec2-79-125-48-125.eu-west-1.compute.amazonaws.com:17070
- ip-10-33-183-137.eu-west-1.compute.internal:17070
- 79.125.48.125:17070
- 10.33.183.137:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80::2000:aff:fe21:b789]:17070'
- ec2-54-217-146-81.eu-west-1.compute.amazonaws.com:17070
- ip-10-73-128-8.eu-west-1.compute.internal:17070
- 54.217.146.81:17070
- 10.73.128.8:17070
- 127.0.0.1:17070
- '[::1]:17070'
- '[fe80::2000:aff:fe49:8008]:17070'

while it is odd to have both the EC2 DNS name and the raw IP address listed, I feel it is just wrong to be listing ::1 and 127.0.0.1
The only place those are valid is on the state servers themselves, and there we should be hard-coding "connect only to the local address" so that we don't end up with machine-1 as a state server making all its requests against machine-0's API.

(It probably needs to connect to machine-0 to verify it *is* still considered an API server, but once that finishes it should start its own service and stop connecting to the other machine.)

Tags: ha

Related branches

Revision history for this message
John A Meinel (jameinel) wrote :

Note we also have bug #1308491 that we should be caching the full contents of HostPorts and not just the final Addr. That would potentially let us filter late instead of early. But it still seems wrong to have APIHostPorts() return localhost.

Martin Packman (gz)
Changed in juju-core:
assignee: nobody → Martin Packman (gz)
Go Bot (go-bot)
Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.