juju private-address returns wrong IP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Medium
|
Unassigned | ||
NRPE Charm |
Fix Released
|
Medium
|
Haw Loeung |
Bug Description
Hi,
Nagios checks etc. uses results returned from private-address. Seems on hosts where there's multiple, this can sometimes be wrong:
| ubuntu@comet:~$ sudo juju-run infra/0 "unit-get private-address"
| 10.220.254.1
Is it returning the first?
| ubuntu@comet:~$ sudo juju-run infra/0 "ip -4 addr"
| 1: lo: <LOOPBACK,
| inet 127.0.0.1/8 scope host lo
| valid_lft forever preferred_lft forever
| 8: br-eno2: <BROADCAST,
| inet 10.220.254.1/24 brd 10.220.254.255 scope global br-eno2
| valid_lft forever preferred_lft forever
| 9: br-eno1: <BROADCAST,
| inet 10.222.128.23/22 brd 10.222.131.255 scope global br-eno1
| valid_lft forever preferred_lft forever
Obviously wrong and should be 10.222.128.23:
| ubuntu@comet:~$ sudo juju-run infra/0 "ip route get 8.8.8.8"
| 8.8.8.8 via 10.222.128.1 dev br-eno1 src 10.222.128.23
| cache
This is from an environment deployed using Juju 2.2.3.
Thanks,
Haw
Related branches
- Stuart Bishop (community): Approve
- Barry Price: Approve
-
Diff: 48 lines (+17/-0)1 file modifiedreactive/ubuntu-repository-cache.py (+17/-0)
- Paul Collins: Approve (lgtm)
-
Diff: 40 lines (+19/-3)1 file modifiedhooks/nrpe_helpers.py (+19/-3)
Changed in juju: | |
status: | New → Incomplete |
Changed in nrpe-charm: | |
status: | New → Fix Released |
tags: | added: network |
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in juju: | |
status: | Triaged → Invalid |
Changed in charm-nrpe: | |
importance: | Undecided → Medium |
assignee: | nobody → Haw Loeung (hloeung) |
How are we to tell what address is "wrong" vs "right" when all addresses
are private. (10.220.254.1 is certainly an RFC 1918 address.)
Charms are recommended to move away from "unit-get private-address" to
"network-get" (see docs for more complete information), which allows juju
to know what space/binding/etc the charm is trying to talk about, and
allows us to have enough context to know which address of multiple possible
addresses is correct.
On Mon, Dec 4, 2017 at 6:45 AM, Haw Loeung <email address hidden>
wrote:
> Public bug reported: UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc noqueue MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc noqueue /bugs.launchpad .net/bugs/ 1736050 /bugs.launchpad .net/juju/ +bug/1736050/ +subscriptions
>
> Hi,
>
> Nagios checks etc. uses results returned from private-address. Seems on
> hosts where there's multiple, this can sometimes be wrong:
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "unit-get private-address"
> | 10.220.254.1
>
> Is it returning the first?
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "ip -4 addr"
> | 1: lo: <LOOPBACK,
> group default qlen 1
> | inet 127.0.0.1/8 scope host lo
> | valid_lft forever preferred_lft forever
> | 8: br-eno2: <BROADCAST,
> state UP group default qlen 1000
> | inet 10.220.254.1/24 brd 10.220.254.255 scope global br-eno2
> | valid_lft forever preferred_lft forever
> | 9: br-eno1: <BROADCAST,
> state UP group default qlen 1000
> | inet 10.222.128.23/22 brd 10.222.131.255 scope global br-eno1
> | valid_lft forever preferred_lft forever
>
> Obviously wrong and should be 10.222.128.23:
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "ip route get 8.8.8.8"
> | 8.8.8.8 via 10.222.128.1 dev br-eno1 src 10.222.128.23
> | cache
>
> This is from an environment deployed using Juju 2.2.3.
>
>
> Thanks,
>
> Haw
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https:/
>
> Title:
> juju private-address returns wrong IP
>
> To manage notifications about this bug go to:
> https:/
>