juju status --format summary panics with unresolvable IPs

Bug #1410320 reported by Dimiter Naydenov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Katherine Cox-Buday
1.22
Fix Released
High
Katherine Cox-Buday

Bug Description

I have just found that in my MAAS environment (locally installed on KVMs) running "juju status --format summary" panics with the following output (I've tried all the other --format types - only summary is affected):

[*maas-trusty] dimitern@kubrik:~$ juju status --format summary
WARNING unable to resolve vm0.maas to an IP address. Status may be incorrect: lookup vm0.maas: no such host
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x42387f]

goroutine 1 [running]:
runtime.panic(0xe10680, 0x1d78f08)
 /usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
main.(*summaryFormatter).resolveAndTrackIp(0xc21006b600, 0xc2101512f0, 0x8)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/status_formatters.go:252 +0x19f
main.(*summaryFormatter).aggregateMachineStates(0xc21006b600, 0xc210060600, 0xc21001f900)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/status_formatters.go:259 +0x136
main.FormatSummary(0xe819a0, 0xc21001f900, 0x7fff7a877e29, 0x7, 0xc210121e90, ...)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/status_formatters.go:136 +0x1eb
github.com/juju/cmd.(*formatterValue).format(0xc2101bdb80, 0xe819a0, 0xc21001f900, 0x440532, 0x28, ...)
 /home/dimitern/work/go/src/github.com/juju/cmd/output.go:133 +0x68
github.com/juju/cmd.(*Output).Write(0xc2101a94d0, 0xc2100ffb90, 0xe819a0, 0xc21001f900, 0x0, ...)
 /home/dimitern/work/go/src/github.com/juju/cmd/output.go:163 +0x8f
main.(*StatusCommand).Run(0xc2101a94c0, 0xc2100ffb90, 0x0, 0x0)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/status.go:124 +0x402
github.com/juju/juju/cmd/envcmd.(*environCommandWrapper).Run(0xc2101ab300, 0xc2100ffb90, 0xc32c20, 0xc210135910)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/envcmd/environmentcommand.go:1 +0x3d
main.(*envCmdWrapper).Run(0xc2101ab320, 0xc2100ffb90, 0x7f903aadd8a8, 0xc2101ab320)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/addrelation.go:1 +0x3d
github.com/juju/cmd.(*SuperCommand).Run(0xc210064780, 0xc2100ffb90, 0xc2100ffb90, 0x0)
 /home/dimitern/work/go/src/github.com/juju/cmd/supercommand.go:409 +0x551
github.com/juju/cmd.Main(0x7f903aade9d8, 0xc210064780, 0xc2100ffb90, 0xc21000a010, 0x3, ...)
 /home/dimitern/work/go/src/github.com/juju/cmd/cmd.go:247 +0x283
main.Main(0xc21000a000, 0x4, 0x4)
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/main.go:68 +0x460
main.main()
 /home/dimitern/work/go/src/github.com/juju/juju/cmd/juju/main.go:222 +0x44

goroutine 3 [syscall]:
os/signal.loop()
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
 /usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x31

goroutine 10 [finalizer wait]:
runtime.park(0x4418a0, 0x1d7e768, 0x1d7ad28)
 /usr/lib/go/src/pkg/runtime/proc.c:1342 +0x66
runfinq()
 /usr/lib/go/src/pkg/runtime/mgc0.c:2279 +0x84
runtime.goexit()
 /usr/lib/go/src/pkg/runtime/proc.c:1394

goroutine 19 [syscall]:
runtime.goexit()
 /usr/lib/go/src/pkg/runtime/proc.c:1394

It seems the problem is that node's DNS name "vm0.maas" cannot be resolved on my machine and that causes the panic. This happened after I recently removed my local maas cluster controller's IP from the DNS servers to use by default.

Here's the same environment, but running "juju status" works fine:
[*maas-trusty] dimitern@kubrik:~$ juju status
environment: maas-trusty
machines:
  "0":
    agent-state: started
    agent-version: 1.22-alpha1.1
    dns-name: vm0.maas
    instance-id: /MAAS/api/1.0/nodes/node-fc3bdec0-c163-11e3-84a7-525400355a63/
    series: trusty
    containers:
      0/lxc/0:
        agent-state: started
        agent-version: 1.22-alpha1.1
        dns-name: 192.168.50.37
        instance-id: juju-machine-0-lxc-0
        series: trusty
        hardware: arch=amd64
    hardware: arch=amd64 cpu-cores=1 mem=512M tags=virtual
    state-server-member-status: has-vote
  "1":
    agent-state: started
    agent-version: 1.22-alpha1.1
    dns-name: vm1.maas
    instance-id: /MAAS/api/1.0/nodes/node-1946960e-c164-11e3-8a4b-525400355a63/
    series: trusty
    containers:
      1/lxc/0:
        agent-state: started
        agent-version: 1.22-alpha1.1
        dns-name: 192.168.50.35
        instance-id: juju-machine-1-lxc-0
        series: trusty
        hardware: arch=amd64
    hardware: arch=amd64 cpu-cores=1 mem=512M tags=virtual
services:
  ubuntu:
    charm: cs:trusty/ubuntu-0
    exposed: false
    units:
      ubuntu/0:
        agent-state: started
        agent-version: 1.22-alpha1.1
        machine: 0/lxc/0
        public-address: 192.168.50.37
      ubuntu/1:
        agent-state: started
        agent-version: 1.22-alpha1.1
        machine: "1"
        public-address: vm1.maas
      ubuntu/2:
        agent-state: started
        agent-version: 1.22-alpha1.1
        machine: 1/lxc/0
        public-address: 192.168.50.35
networks:
  maas:
    provider-id: maas
    cidr: 192.168.50.0/24
  maas-eth2:
    provider-id: maas-eth2
    cidr: 192.168.122.0/24
  vlan42:
    provider-id: vlan42
    cidr: 192.168.222.0/28
    vlan-tag: 42
  vlan1234:
    provider-id: vlan1234
    cidr: 192.168.242.0/28
    vlan-tag: 1234

Changed in juju-core:
assignee: nobody → Katherine Cox-Buday (cox-katherine-e)
Changed in juju-core:
milestone: none → 1.23
Changed in juju-core:
status: Triaged → In Progress
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.23 → 1.23-beta1
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.