三月 31, 2015

mackerel-agentとFreeBSDと午前3時

二つ借りているさくらVPSでmackerel-agentを起動している。ところが、片方のmackerel-agentが午前3時頃になるとpanicを起こして異常終了してしまう。原因はすぐにはわからないし、FreeBSDはまだサポートされていないので、ひとまずログだけ残しておく。余力があればあとで調べたい。

mackerel-agentとFreeBSDと午前3時

二つ借りているさくらVPSでmackerel-agentを起動している。ところが、片方のmackerel-agentが午前3時頃になるとpanicを起こして異常終了してしまう。原因はすぐにはわからないし、FreeBSDはまだサポートされていないので、ひとまずログだけ残しておく。余力があればあとで調べたい。

panic: runtime error: index out of range

goroutine 14195 [running]:
github.com/mackerelio/mackerel-agent/metrics/freebsd.(*MemoryGenerator).Generate(0x909bf8, 0x513e07, 0x0, 0x0)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/metrics/freebsd/memory.go:70 +0xac2
github.com/mackerelio/mackerel-agent/agent.funcツキ005(0x80093e798, 0x909bf8)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:37 +0x67
created by github.com/mackerelio/mackerel-agent/agent.funcツキ006
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:43 +0x16c

goroutine 1 [select]:
github.com/mackerelio/mackerel-agent/command.loop(0xc208321360, 0xc20828ba40, 0x0)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:155 +0xf64
github.com/mackerelio/mackerel-agent/command.Run(0xc20806c160, 0xc20800a020, 0xc208225400, 0xc20828ba40, 0x800932a80)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:365 +0x582
main.start(0xc20806c160, 0x0, 0x0)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/main.go:212 +0x59e
main.main()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/main.go:67 +0x307

goroutine 5 [syscall, 823 minutes]:
os/signal.loop()
	/home/don/src/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.initツキ1
	/home/don/src/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 20 [chan receive, 821 minutes]:
main.funcツキ003()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/main.go:186 +0x96
created by main.start
	/home/don/go/src/github.com/mackerelio/mackerel-agent/main.go:210 +0x564

goroutine 23 [chan receive]:
github.com/mackerelio/mackerel-agent/agent.funcツキ001()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:45 +0x100
created by github.com/mackerelio/mackerel-agent/agent.(*Agent).Watch
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:54 +0x126

goroutine 17 [syscall, 823 minutes, locked to thread]:
runtime.goexit()
	/home/don/src/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 14189 [chan receive]:
github.com/mackerelio/mackerel-agent/agent.(*Agent).collectMetrics(0xc2082e4570, 0xeccab8698, 0x293794ea, 0x901280, 0xc20828b200)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:29 +0x24c
github.com/mackerelio/mackerel-agent/agent.funcツキ002()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:66 +0x4b
created by github.com/mackerelio/mackerel-agent/agent.funcツキ003
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:68 +0x250

goroutine 21 [select, 41 minutes]:
github.com/mackerelio/mackerel-agent/command.updateHostSpecsLoop(0xc208321360, 0xc20828bb60)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:256 +0x102
created by github.com/mackerelio/mackerel-agent/command.loop
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:138 +0xdf

goroutine 22 [select]:
github.com/mackerelio/mackerel-agent/command.enqueueLoop(0xc208321360, 0xc20828bbc0, 0xc20828bb60)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:268 +0x77a
created by github.com/mackerelio/mackerel-agent/command.loop
	/home/don/go/src/github.com/mackerelio/mackerel-agent/command/command.go:141 +0x17f

goroutine 24 [chan receive]:
github.com/mackerelio/mackerel-agent/agent.funcツキ003()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:62 +0xdf
created by github.com/mackerelio/mackerel-agent/agent.(*Agent).Watch
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/agent.go:70 +0x1c4

goroutine 14193 [syscall]:
syscall.Syscall6(0x7, 0x9200, 0xc2080a2b1c, 0x0, 0xc2082cb320, 0x0, 0x0, 0xc208052f00, 0x405521, 0xc208052f20)
	/home/don/src/go/src/syscall/asm_freebsd_amd64.s:49 +0x5
syscall.wait4(0x9200, 0xc2080a2b1c, 0x0, 0xc2082cb320, 0x90, 0x0, 0x0)
	/home/don/src/go/src/syscall/zsyscall_freebsd_amd64.go:32 +0x79
syscall.Wait4(0x9200, 0xc2080a2b64, 0x0, 0xc2082cb320, 0x0, 0x0, 0x0)
	/home/don/src/go/src/syscall/syscall_bsd.go:162 +0x60
os.(*Process).wait(0xc208311680, 0x0, 0x0, 0x0)
	/home/don/src/go/src/os/exec_unix.go:22 +0x103
os.(*Process).Wait(0xc208311680, 0xc2082f2b90, 0x0, 0x0)
	/home/don/src/go/src/os/doc.go:45 +0x3a
os/exec.(*Cmd).Wait(0xc208386280, 0x0, 0x0)
	/home/don/src/go/src/os/exec/exec.go:364 +0x23c
os/exec.(*Cmd).Run(0xc208386280, 0x0, 0x0)
	/home/don/src/go/src/os/exec/exec.go:246 +0x71
os/exec.(*Cmd).Output(0xc208386280, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/don/src/go/src/os/exec/exec.go:392 +0x1d3
github.com/mackerelio/mackerel-agent/metrics/freebsd.(*CPUUsageGenerator).Generate(0x909bf8, 0x513e07, 0x0, 0x0)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/metrics/freebsd/cpuusage.go:35 +0xc1
github.com/mackerelio/mackerel-agent/agent.funcツキ005(0x80093e748, 0x909bf8)
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:37 +0x67
created by github.com/mackerelio/mackerel-agent/agent.funcツキ006
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:43 +0x16c

goroutine 14198 [syscall]:
syscall.Syscall(0x3, 0xc, 0xc20823ec31, 0x5cf, 0x31, 0x200, 0x0)
	/home/don/src/go/src/syscall/asm_freebsd_amd64.s:26 +0x5
syscall.read(0xc, 0xc20823ec31, 0x5cf, 0x5cf, 0x0, 0x0, 0x0)
	/home/don/src/go/src/syscall/zsyscall_freebsd_amd64.go:890 +0x6e
syscall.Read(0xc, 0xc20823ec31, 0x5cf, 0x5cf, 0xc20801c5a0, 0x0, 0x0)
	/home/don/src/go/src/syscall/syscall_unix.go:136 +0x58
os.(*File).read(0xc2080385c8, 0xc20823ec31, 0x5cf, 0x5cf, 0xc20823ec00, 0x0, 0x0)
	/home/don/src/go/src/os/file_unix.go:191 +0x86
os.(*File).Read(0xc2080385c8, 0xc20823ec31, 0x5cf, 0x5cf, 0x31, 0x0, 0x0)
	/home/don/src/go/src/os/file.go:95 +0x91
bytes.(*Buffer).ReadFrom(0xc2083a4310, 0x800937088, 0xc2080385c8, 0x31, 0x0, 0x0)
	/home/don/src/go/src/bytes/buffer.go:169 +0x25a
io.Copy(0x8009372e0, 0xc2083a4310, 0x800937088, 0xc2080385c8, 0x0, 0x0, 0x0)
	/home/don/src/go/src/io/io.go:358 +0x13d
os/exec.funcツキ003(0x0, 0x0)
	/home/don/src/go/src/os/exec/exec.go:221 +0x7d
os/exec.funcツキ004(0xc2083111c0)
	/home/don/src/go/src/os/exec/exec.go:328 +0x2d
created by os/exec.(*Cmd).Start
	/home/don/src/go/src/os/exec/exec.go:329 +0xb6d

goroutine 14191 [semacquire]:
sync.(*WaitGroup).Wait(0xc208310ee0)
	/home/don/src/go/src/sync/waitgroup.go:132 +0x169
github.com/mackerelio/mackerel-agent/agent.funcツキ006()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:45 +0x19b
created by github.com/mackerelio/mackerel-agent/agent.generateValues
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:47 +0x265

goroutine 14190 [select]:
github.com/mackerelio/mackerel-agent/agent.funcツキ004()
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:20 +0x154
created by github.com/mackerelio/mackerel-agent/agent.generateValues
	/home/don/go/src/github.com/mackerelio/mackerel-agent/agent/generator.go:28 +0x1c7