しまかぜメモ

@kinunoriの雑なメモ

mackerel-agentが起動しなくなってしまった

追記:
OpenStackをインストールする過程で再起動したら直ってしまった。 原因は分からず。


原因は分からないけど、とりあえずログをメモ

2015/09/15 11:37:42 INFO <main> Starting mackerel-agent version:0.22.0, rev:c5d822c, apibase:https://mackerel.io
panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/mackerelio/mackerel-agent/spec/linux.(*InterfaceGenerator).generateByIPCommand(0x846281c, 0x2, 0x0, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/spec/linux/interface.go:122 +0xec3
github.com/mackerelio/mackerel-agent/spec/linux.(*InterfaceGenerator).Generate(0x846281c, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/spec/linux/interface.go:32 +0x88
github.com/mackerelio/mackerel-agent/command.collectHostSpecs(0x0, 0x0, 0x82ee3e0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/command/command.go:479 +0x544
github.com/mackerelio/mackerel-agent/command.prepareHost(0xffcc0f20, 0x17, 0x1867b6a0, 0x846281c, 0x0, 0x0, 0x846281c, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/mackerelio/mackerel-agent/command/command.go:93 +0x1b0
github.com/mackerelio/mackerel-agent/command.Prepare(0x1863ca10, 0x1b, 0x0, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/command/command.go:523 +0x1f3
main.start(0x1863ca10, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/main.go:293 +0xad
main.doMain(0x1860a008, 0x2, 0x2, 0x0)
        /go/src/github.com/mackerelio/mackerel-agent/main.go:95 +0x258
main.dispatch(0x1860a008, 0x2, 0x2, 0x18629fbc)
        /go/src/github.com/mackerelio/mackerel-agent/dispatch.go:20 +0x17a
main.main()
        /go/src/github.com/mackerelio/mackerel-agent/main.go:52 +0x5d

goroutine 5 [syscall]:
os/signal.loop()
        /opt/local/go/src/os/signal/signal_unix.go:21 +0x21
created by os/signal.init・1
        /opt/local/go/src/os/signal/signal_unix.go:27 +0x34

goroutine 14 [select]:
net.lookupIPDeadline(0xffcc0f60, 0x12, 0xcd897b94, 0xe, 0x306a1058, 0x845c080, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/local/go/src/net/lookup.go:82 +0x5df
net.resolveInternetAddr(0x82efdf0, 0x3, 0xffcc0f60, 0x17, 0xcd897b94, 0xe, 0x306a1058, 0x845c080, 0x0, 0x0, ...)
        /opt/local/go/src/net/ipsock.go:285 +0x394
net.resolveAddr(0x82f3938, 0x4, 0x82efdf0, 0x3, 0xffcc0f60, 0x17, 0xcd897b94, 0xe, 0x306a1058, 0x845c080, ...)
        /opt/local/go/src/net/dial.go:110 +0x2a0
net.(*Dialer).Dial(0x1860c1e0, 0x82efdf0, 0x3, 0xffcc0f60, 0x17, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dial.go:158 +0xe1
net.*Dialer.Dial・fm(0x82efdf0, 0x3, 0xffcc0f60, 0x17, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/http/transport.go:38 +0x67
net/http.(*Transport).dial(0x1863c310, 0x82efdf0, 0x3, 0xffcc0f60, 0x17, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/http/transport.go:479 +0x73
net/http.(*Transport).dialConn(0x1863c310, 0x186ac7c0, 0x186105a0, 0x4, 0x186b6220, 0x1b, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/http/transport.go:564 +0x1238
net/http.func・019()
        /opt/local/go/src/net/http/transport.go:520 +0x3d
created by net/http.(*Transport).getConn
        /opt/local/go/src/net/http/transport.go:522 +0x298

goroutine 15 [chan receive]:
net.goLookupIP(0xffcc0f60, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:392 +0x3a5
net.lookupIP(0xffcc0f60, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/lookup_unix.go:66 +0x85
net.func・026(0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/lookup.go:79 +0x4a
net.(*singleflight).doCall(0x845bd68, 0x186acac0, 0xffcc0f60, 0x12, 0x1861cfc8)
        /opt/local/go/src/net/singleflight.go:91 +0x24
created by net.(*singleflight).DoChan
        /opt/local/go/src/net/singleflight.go:84 +0x31a

goroutine 17 [IO wait]:
net.(*pollDesc).Wait(0x186acc38, 0x72, 0x0, 0x0)
        /opt/local/go/src/net/fd_poll_runtime.go:84 +0x42
net.(*pollDesc).WaitRead(0x186acc38, 0x0, 0x0)
        /opt/local/go/src/net/fd_poll_runtime.go:89 +0x40
net.(*netFD).Read(0x186acc00, 0x186a0200, 0x200, 0x200, 0x0, 0xf76fcd28, 0x186b4050)
        /opt/local/go/src/net/fd_unix.go:242 +0x2f0
net.(*conn).Read(0x1861cff0, 0x186a0200, 0x200, 0x200, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/net.go:121 +0xba
net.(*UDPConn).readDNSResponse(0x1861cff0, 0x186acbc0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:43 +0x92
net.exchange(0x186b4400, 0x10, 0x186b6420, 0x13, 0x186b001c, 0x2a05f200, 0x1, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:146 +0x418
net.tryOneName(0x1860cd80, 0x186b6420, 0x13, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/local/go/src/net/dnsclient_unix.go:175 +0x3a3
net.lookup(0xffcc0f60, 0x12, 0x1c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:299 +0x582
net.func・020(0x186b001c)
        /opt/local/go/src/net/dnsclient_unix.go:386 +0x3b
created by net.goLookupIP
        /opt/local/go/src/net/dnsclient_unix.go:388 +0x336

goroutine 16 [IO wait]:
net.(*pollDesc).Wait(0x186acbb8, 0x72, 0x0, 0x0)
        /opt/local/go/src/net/fd_poll_runtime.go:84 +0x42
net.(*pollDesc).WaitRead(0x186acbb8, 0x0, 0x0)
        /opt/local/go/src/net/fd_poll_runtime.go:89 +0x40
net.(*netFD).Read(0x186acb80, 0x186a0800, 0x200, 0x200, 0x0, 0xf76fcd28, 0x186b43f0)
        /opt/local/go/src/net/fd_unix.go:242 +0x2f0
net.(*conn).Read(0x1861cfe8, 0x186a0800, 0x200, 0x200, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/net.go:121 +0xba
net.(*UDPConn).readDNSResponse(0x1861cfe8, 0x186acb40, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:43 +0x92
net.exchange(0x186b4360, 0x10, 0x186b6340, 0x13, 0x186b0001, 0x2a05f200, 0x1, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:146 +0x418
net.tryOneName(0x1860cd80, 0x186b6340, 0x13, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /opt/local/go/src/net/dnsclient_unix.go:175 +0x3a3
net.lookup(0xffcc0f60, 0x12, 0x20001, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /opt/local/go/src/net/dnsclient_unix.go:299 +0x582
net.func・020(0x186b0001)
        /opt/local/go/src/net/dnsclient_unix.go:386 +0x3b
created by net.goLookupIP
        /opt/local/go/src/net/dnsclient_unix.go:388 +0x336

goroutine 11 [sleep]:
net.func・019()
        /opt/local/go/src/net/dnsclient_unix.go:240 +0x54
created by net.loadConfig
        /opt/local/go/src/net/dnsclient_unix.go:269 +0x1aa

goroutine 19 [chan receive]:
net/http.func・016()
        /opt/local/go/src/net/http/transport.go:507 +0x58
created by net/http.func・017
        /opt/local/go/src/net/http/transport.go:513 +0x9c
[root@xxxx02]systemctl status mackerel-agent.service         [/etc/sysconfig]
mackerel-agent.service - LSB: start and stop mackerel-agent
   Loaded: loaded (/etc/rc.d/init.d/mackerel-agent)
   Active: failed (Result: exit-code) since Tue 2015-09-15 11:40:15 JST; 3min 15s ago
  Process: 19010 ExecStart=/etc/rc.d/init.d/mackerel-agent start (code=exited, status=1/FAILURE)

Sep 15 11:40:12 xxxx02 systemd[1]: Starting LSB: start ...
Sep 15 11:40:15 xxxx02 mackerel-agent[19010]: Starting ...
Sep 15 11:40:15 xxxx02 systemd[1]: mackerel-agent.servi...
Sep 15 11:40:15 xxxx02 systemd[1]: Failed to start LSB:...
Sep 15 11:40:15 xxxx02 systemd[1]: Unit mackerel-agent....
Hint: Some lines were ellipsized, use -l to show in full.