Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Uchiwa 0.17.2 crashes periodically #562

Closed
inferiorhumanorgans opened this issue Sep 10, 2016 · 5 comments
Closed

Uchiwa 0.17.2 crashes periodically #562

inferiorhumanorgans opened this issue Sep 10, 2016 · 5 comments
Labels

Comments

@inferiorhumanorgans
Copy link

inferiorhumanorgans commented Sep 10, 2016

fatal error: concurrent map read and map write

goroutine 1257460 [running]:
runtime.throw(0x88a7a0, 0x21)
   /usr/local/go/src/runtime/panic.go:547 +0x90 fp=0xc8203270f8 sp=0xc8203270e0
runtime.mapaccessK(0x71f2e0, 0xc8203b88d0, 0xc8203ba288, 0x82a260, 0x0)
   /usr/local/go/src/runtime/hashmap.go:389 +0x5a fp=0xc820327140 sp=0xc8203270f8
runtime.mapiternext(0xc82005ea20)
   /usr/local/go/src/runtime/hashmap.go:774 +0x63e fp=0xc8203271d0 sp=0xc820327140
reflect.mapiternext(0xc82005ea20)
   /usr/local/go/src/runtime/hashmap.go:1020 +0x21 fp=0xc8203271e0 sp=0xc8203271d0
reflect.Value.MapKeys(0x71f2e0, 0xc8203b88d0, 0x15, 0x0, 0x0, 0x0)
   /usr/local/go/src/reflect/value.go:1095 +0x294 fp=0xc8203272a0 sp=0xc8203271e0
encoding/json.(*mapEncoder).encode(0xc820152010, 0xc820132000, 0x71f2e0, 0xc8203b88d0, 0x15, 0x0)
   /usr/local/go/src/encoding/json/encode.go:614 +0xd6 fp=0xc820327390 sp=0xc8203272a0
encoding/json.(*mapEncoder).(encoding/json.encode)-fm(0xc820132000, 0x71f2e0, 0xc8203b88d0, 0x15, 0x0)
   /usr/local/go/src/encoding/json/encode.go:632 +0x51 fp=0xc8203273c8 sp=0xc820327390
encoding/json.(*encodeState).reflectValue(0xc820132000, 0x71f2e0, 0xc8203b88d0, 0x15)
   /usr/local/go/src/encoding/json/encode.go:301 +0x6b fp=0xc8203273f8 sp=0xc8203273c8
encoding/json.interfaceEncoder(0xc820132000, 0x71c8a0, 0xc82047e8e0, 0x94, 0xc82047e800)
   /usr/local/go/src/encoding/json/encode.go:560 +0xd8 fp=0xc820327448 sp=0xc8203273f8
encoding/json.(*mapEncoder).encode(0xc820152010, 0xc820132000, 0x71f2e0, 0xc8203b8870, 0x15, 0x0)
   /usr/local/go/src/encoding/json/encode.go:622 +0x344 fp=0xc820327538 sp=0xc820327448
encoding/json.(*mapEncoder).(encoding/json.encode)-fm(0xc820132000, 0x71f2e0, 0xc8203b8870, 0x15, 0x0)
   /usr/local/go/src/encoding/json/encode.go:632 +0x51 fp=0xc820327570 sp=0xc820327538
encoding/json.(*encodeState).reflectValue(0xc820132000, 0x71f2e0, 0xc8203b8870, 0x15)
   /usr/local/go/src/encoding/json/encode.go:301 +0x6b fp=0xc8203275a0 sp=0xc820327570
encoding/json.interfaceEncoder(0xc820132000, 0x71c8a0, 0xc82047e7c0, 0x194, 0x71c800)
   /usr/local/go/src/encoding/json/encode.go:560 +0xd8 fp=0xc8203275f0 sp=0xc8203275a0
encoding/json.(*arrayEncoder).encode(0xc820152480, 0xc820132000, 0x70f3a0, 0xc820472740, 0x97, 0x8d9d00)
   /usr/local/go/src/encoding/json/encode.go:690 +0x11b fp=0xc820327658 sp=0xc8203275f0
encoding/json.(*arrayEncoder).(encoding/json.encode)-fm(0xc820132000, 0x70f3a0, 0xc820472740, 0x97, 0x70f300)
   /usr/local/go/src/encoding/json/encode.go:697 +0x51 fp=0xc820327690 sp=0xc820327658
encoding/json.(*sliceEncoder).encode(0xc820152488, 0xc820132000, 0x70f3a0, 0xc820472740, 0x97, 0x0)
   /usr/local/go/src/encoding/json/encode.go:667 +0xb0 fp=0xc8203276c8 sp=0xc820327690
encoding/json.(*sliceEncoder).(encoding/json.encode)-fm(0xc820132000, 0x70f3a0, 0xc820472740, 0x97, 0xc820472700)
   /usr/local/go/src/encoding/json/encode.go:676 +0x51 fp=0xc820327700 sp=0xc8203276c8
encoding/json.(*encodeState).reflectValue(0xc820132000, 0x70f3a0, 0xc820472740, 0x97)
   /usr/local/go/src/encoding/json/encode.go:301 +0x6b fp=0xc820327730 sp=0xc820327700
encoding/json.(*encodeState).marshal(0xc820132000, 0x70f3a0, 0xc820472740, 0x0, 0x0)
   /usr/local/go/src/encoding/json/encode.go:274 +0xa9 fp=0xc820327778 sp=0xc820327730
encoding/json.(*Encoder).Encode(0xc820327940, 0x70f3a0, 0xc820472740, 0x0, 0x0)
   /usr/local/go/src/encoding/json/stream.go:188 +0x94 fp=0xc820327808 sp=0xc820327778
github.com/sensu/uchiwa/uchiwa.(*Uchiwa).eventsHandler(0xc8200116b0, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/server.go:568 +0x6e4 fp=0xc820327968 sp=0xc820327808
github.com/sensu/uchiwa/uchiwa.(*Uchiwa).(github.com/sensu/uchiwa/uchiwa.eventsHandler)-fm(0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/server.go:922 +0x3e fp=0xc820327990 sp=0xc820327968
net/http.HandlerFunc.ServeHTTP(0xc82000bb60, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc8203279b0 sp=0xc820327990
github.com/sensu/uchiwa/uchiwa/authorization.(*Uchiwa).Handler.func1(0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/authorization/authorization.go:29 +0x12c fp=0xc820327a18 sp=0xc8203279b0
net/http.HandlerFunc.ServeHTTP(0xc82035f960, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc820327a38 sp=0xc820327a18
github.com/sensu/uchiwa/uchiwa/authentication.restrictedHandler.func1(0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/authentication/controllers.go:52 +0x316 fp=0xc820327ae8 sp=0xc820327a38
net/http.HandlerFunc.ServeHTTP(0xc82035f980, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /usr/local/go/src/net/http/server.go:1618 +0x3a fp=0xc820327b08 sp=0xc820327ae8
net/http.(*ServeMux).ServeHTTP(0xc820010bd0, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /usr/local/go/src/net/http/server.go:1910 +0x17d fp=0xc820327b60 sp=0xc820327b08
net/http.serverHandler.ServeHTTP(0xc82034fd80, 0x800a9fa58, 0xc82006e1a0, 0xc8203a88c0)
   /usr/local/go/src/net/http/server.go:2081 +0x19e fp=0xc820327bc0 sp=0xc820327b60
net/http.(*conn).serve(0xc820375700)
   /usr/local/go/src/net/http/server.go:1472 +0xf2e fp=0xc820327f88 sp=0xc820327bc0
runtime.goexit()
   /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc820327f90 sp=0xc820327f88
created by net/http.(*Server).Serve
   /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 1 [IO wait]:
net.runtime_pollWait(0x800ad4000, 0x72, 0x0)
   /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820354680, 0x72, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820354680, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc820354620, 0x0, 0x800a9f988, 0xc8200e6f00)
   /usr/local/go/src/net/fd_unix.go:426 +0x27c
net.(*TCPListener).AcceptTCP(0xc8200280b0, 0x450870, 0x0, 0x0)
   /usr/local/go/src/net/tcpsock_posix.go:254 +0x4d
net/http.tcpKeepAliveListener.Accept(0xc8200280b0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:2427 +0x41
net/http.(*Server).Serve(0xc82034fd80, 0x800a9f950, 0xc8200280b0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:2117 +0x129
net/http.(*Server).ListenAndServe(0xc82034fd80, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:2098 +0x136
net/http.ListenAndServe(0xc82000bc70, 0xf, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:2195 +0x98
github.com/sensu/uchiwa/uchiwa.(*Uchiwa).WebServer(0xc8200116b0, 0xc82000b0a0, 0x82f600, 0x6, 0x0, 0x0, 0x0, 0x0, 0x8db378, 0x82f600, ...)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/server.go:949 +0x167b
main.main()
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa.go:40 +0x3f2

goroutine 17 [syscall, 3944 minutes, locked to thread]:
runtime.goexit()
   /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1

goroutine 5 [chan receive]:
github.com/sensu/uchiwa/uchiwa/daemon.(*Daemon).Start(0xc8200c5440, 0x5, 0xc82005e2a0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/daemon/daemon.go:41 +0x1d5
created by github.com/sensu/uchiwa/uchiwa.Init
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/main.go:48 +0x287

goroutine 6 [chan receive]:
github.com/sensu/uchiwa/uchiwa.(*Uchiwa).listener(0xc8200116b0, 0x5, 0xc82005e2a0)
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/main.go:96 +0x1ab
created by github.com/sensu/uchiwa/uchiwa.Init
   /home/alex/go/src/github.com/sensu/uchiwa/uchiwa/main.go:49 +0x2bd

goroutine 1257487 [IO wait]:
net.runtime_pollWait(0x800b5de80, 0x72, 0xc82044c000)
   /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820054d10, 0x72, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820054d10, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820054cb0, 0xc82044c000, 0x1000, 0x1000, 0x0, 0x800a93050, 0xc82000a098)
   /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc82046e038, 0xc82044c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc82035ea60, 0xc82044c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc820342600)
   /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc820342600, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc820342600, 0x0, 0x0, 0x0, 0x811900, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc8203b8000, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc8203b8000, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc820342600, 0x200, 0xc8200df0a0, 0x0, 0x0)
   /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc82036a500, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc82036a500)
   /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
   /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 1257400 [IO wait]:
net.runtime_pollWait(0x800ad3d00, 0x72, 0xc8200d2000)
   /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc8201308b0, 0x72, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8201308b0, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc820130850, 0xc8200d2000, 0x1000, 0x1000, 0x0, 0x800a93050, 0xc82000a098)
   /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc820153a80, 0xc8200d2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc82035fd60, 0xc8200d2000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc82005e660)
   /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc82005e660, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc82005e660, 0x0, 0x0, 0x0, 0x811900, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc820482a80, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc820482a80, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc82005e660, 0x0, 0xc8203a80e0, 0x0, 0x0)
   /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc820375280, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc820375280)
   /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
   /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 1257076 [IO wait]:
net.runtime_pollWait(0x800ad3dc0, 0x72, 0xc82039a000)
   /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc82028c6f0, 0x72, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82028c6f0, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82028c690, 0xc82039a000, 0x1000, 0x1000, 0x0, 0x800a93050, 0xc82000a098)
   /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc820152028, 0xc82039a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc8203908e0, 0xc82039a000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc8202746c0)
   /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc8202746c0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc8202746c0, 0x0, 0x0, 0x0, 0x811900, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc820482090, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:55 +0x81
net/textproto.(*Reader).ReadLine(0xc820482090, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/textproto/reader.go:36 +0x40
net/http.readRequest(0xc8202746c0, 0x200, 0xc8203a8000, 0x0, 0x0)
   /usr/local/go/src/net/http/request.go:721 +0xb6
net/http.(*conn).readRequest(0xc82034e280, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:705 +0x359
net/http.(*conn).serve(0xc82034e280)
   /usr/local/go/src/net/http/server.go:1425 +0x947
created by net/http.(*Server).Serve
   /usr/local/go/src/net/http/server.go:2137 +0x44e

goroutine 1257405 [IO wait]:
net.runtime_pollWait(0x800ad3100, 0x72, 0xc8200d6000)
   /usr/local/go/src/runtime/netpoll.go:160 +0x60
net.(*pollDesc).Wait(0xc820131100, 0x72, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc820131100, 0x0, 0x0)
   /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8201310a0, 0xc8200d6000, 0x1000, 0x1000, 0x0, 0x800a93050, 0xc82000a098)
   /usr/local/go/src/net/fd_unix.go:250 +0x23a
net.(*conn).Read(0xc820153a98, 0xc8200d6000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/net.go:172 +0xe4
net/http.(*connReader).Read(0xc8203702e0, 0xc8200d6000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
   /usr/local/go/src/net/http/server.go:526 +0x196
bufio.(*Reader).fill(0xc82005eea0)
   /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc82005eea0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadLine(0xc82005eea0, 0x0, 0x0, 0x0, 0x811900, 0x0, 0x0)
   /usr/local/go/src/bufio/bufio.go:357 +0x53
net/textproto.(*Reader).readLineSlice(0xc8203b9710, 0x0, 0x0, 0x0, 0x0, 0x0)
$ go version
go version go1.6.2 freebsd/amd64
@josephholsten
Copy link

yuk. the error is happening inside uchiwa/server.go:568, but I'm not sure I trust this link. @inferiorhumanorgans can you specify the exact release or revision of uchiwa you're running?

I wonder if Filters.Events() is actually recursively duplicating the events.

@inferiorhumanorgans
Copy link
Author

This was with "0.17.2" -- would be good to see that tagged. I've not explicitly defined any filters.

@palourde palourde added the Bug label Sep 13, 2016
@palourde
Copy link
Contributor

It looks like this issue was already reported and fixed with the 0.18 release: #543

Could you let us know if you still face this issue with the newer versions?

Thanks

@inferiorhumanorgans
Copy link
Author

So far so good.

@palourde
Copy link
Contributor

Thanks! Do not hesitate to open a new issue if you still face any issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants