olebedev / go-starter-kit

[abandoned] Golang isomorphic react/hot reloadable/redux/css-modules/SSR starter kit
Other
2.82k stars 357 forks source link

"panic recover interface conversion: interface is *errors.errorString, not string" when sending get request #60

Closed kuzemkon closed 7 years ago

kuzemkon commented 8 years ago

I am trying to serve the app on vm ubuntu x64 using vagrant. After install Go v1.7.1, Node.Js v6.7.0 I set enviropment variables: export GOPATH=pwd export PATH=$PATH:$GOPATH/bin export GO15VENDOREXPERIMENT=1 cd bin export GOBIN=$(pwd) export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin. Then I was installed all dependencies runing make install and build it by make build. When I start the server using make serve, it start's successfull. Terminal shows me ==> 🌎 Listening on port 5001. Open up http://localhost:5001/ in your browser. , but when I making request in browser to localhost:5001 the terminal shows me 500 error of GET request and I received panic recover interface conversion: interface is *errors.errorString, not string stack trace 8250 bytes in my browser. I gave 4GB memory for vagrant, because, if I used less, I received "Cannot allocate memory". image

olebedev commented 8 years ago

Hi @gameiro9k,

could you attach stack trace and diff which was applied(if any) here?

kuzemkon commented 8 years ago

Hello, @olebedev , here it:


 interface conversion: interface is _errors.errorString, not string
 stack trace 6218 bytes
 goroutine 7 [running]:
gopkg.in/labstack/echo.v1/middleware.Recover.func1.1.1(0xc420073300)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/middleware/recover.go:20 +0xbc
panic(0x90b340, 0xc4201c0200)
    /usr/local/go/src/runtime/panic.go:458 +0x243
main.(_React).Handle.func1(0xc420073300, 0xc4201ad940)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/react.go:57 +0xce
panic(0x8fd360, 0xc4201adc60)
    /usr/local/go/src/runtime/panic.go:458 +0x243
main.Must(0xdf3040, 0xc4201adc60)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/utils.go:6 +0x5c
main.newReactVM(0x0, 0x0, 0xdf31c0, 0xc420015860, 0xc4200395f8)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/react.go:164 +0x15c
main.(_onDemandPool).get(0xc4200b9f80, 0x9d9330)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/react.go:215 +0x49
main.(_React).Handle(0xc4201aa600, 0xc420073300, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/react.go:62 +0xec
main.NewApp.func4.1(0xc420073300, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/app.go:158 +0x188
gopkg.in/labstack/echo%2ev1.wrapHandlerFuncMW.func1.1(0xc420073300, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:675 +0x61
gopkg.in/labstack/echo%2ev1.wrapHandlerFuncMW.func1.1(0xc420073300, 0x9d8df8, 0xc420073300)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:675 +0x61
gopkg.in/labstack/echo.v1/middleware.Recover.func1.1(0xc420073300, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/middleware/recover.go:25 +0x75
gopkg.in/labstack/echo.v1/middleware.Logger.func1.1(0xc420073300, 0xc4201ad920, 0x3)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/middleware/logger.go:33 +0x10a
gopkg.in/labstack/echo%2ev1.(_Echo).ServeHTTP(0xc420015860, 0xdf8400, 0xc42011b5f0, 0xc4200bc4b0)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:557 +0x1ca
net/http.serverHandler.ServeHTTP(0xc420073080, 0xdf8400, 0xc42011b5f0, 0xc4200bc4b0)
    /usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(_conn).serve(0xc420073180, 0xdf8e40, 0xc42001bc80)
    /usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:2293 +0x44d

goroutine 1 [IO wait]:
net.runtime_pollWait(0x2adae6913098, 0x72, 0x0)
    /usr/local/go/src/runtime/netpoll.go:160 +0x59
net.(_pollDesc).wait(0xc4201b4a00, 0x72, 0xc420051320, 0xc4200101d0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x38
net.(_pollDesc).waitRead(0xc4201b4a00, 0xdf58c0, 0xc4200101d0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x34
net.(_netFD).accept(0xc4201b49a0, 0x0, 0xdf42c0, 0xc4201b0820)
    /usr/local/go/src/net/fd_unix.go:419 +0x238
net.(_TCPListener).accept(0xc420028268, 0x29e8d60800, 0x0, 0x0)
    /usr/local/go/src/net/tcpsock_posix.go:132 +0x2e
net.(_TCPListener).AcceptTCP(0xc420028268, 0xc420051448, 0xc420051450, 0xc420051440)
    /usr/local/go/src/net/tcpsock.go:209 +0x49
net/http.tcpKeepAliveListener.Accept(0xc420028268, 0x9d9618, 0xc420073180, 0xdf8f00, 0xc4201ab590)
    /usr/local/go/src/net/http/server.go:2608 +0x2f
net/http.(_Server).Serve(0xc420073080, 0xdf8900, 0xc420028268, 0x0, 0x0)
    /usr/local/go/src/net/http/server.go:2273 +0x1ce
net/http.(_Server).ListenAndServe(0xc420073080, 0xc4201ad7f0, 0xe1cde0)
    /usr/local/go/src/net/http/server.go:2219 +0xb4
gopkg.in/labstack/echo%2ev1.(_Echo).run(0xc420015860, 0xc420073080, 0x0, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:593 +0x1bf
gopkg.in/labstack/echo%2ev1.(_Echo).Run(0xc420015860, 0xc4201ad7f0, 0x5)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:572 +0xc2
main.(_App).Run(0xc4200b9fa0)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/app.go:170 +0xbe
main.RunServer(0xc4200d1200)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/main.go:37 +0x4b
github.com/codegangsta/cli.Command.Run(0x98994f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x98fa6d, 0xb, 0x0, ...)
    /home/vagrant/fsAdventCalendar/src/github.com/codegangsta/cli/command.go:137 +0xa8b
github.com/codegangsta/cli.(*App).Run(0xc4200d0fc0, 0xc42000c2e0, 0x2, 0x2, 0x0, 0x0)
    /home/vagrant/fsAdventCalendar/src/github.com/codegangsta/cli/app.go:176 +0x919
main.Run(0xc42000c2e0, 0x2, 0x2)
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/main.go:28 +0xed
main.main()
    /home/vagrant/fsAdventCalendar/src/adcalendar/server/main.go:10 +0x45

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

goroutine 6 [runnable]:
syscall.Syscall(0x1, 0x1, 0xc4201c01c0, 0x2f, 0x2f, 0x2f, 0x0)
    /usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.write(0x1, 0xc4201c01c0, 0x2f, 0x40, 0x0, 0x0, 0x0)
    /usr/local/go/src/syscall/zsyscall_linux_amd64.go:1064 +0x55
syscall.Write(0x1, 0xc4201c01c0, 0x2f, 0x40, 0xc4201b0bf1, 0x1, 0xc400000064)
    /usr/local/go/src/syscall/syscall_unix.go:180 +0x49
os.(_File).write(0xc420028010, 0xc4201c01c0, 0x2f, 0x40, 0x6, 0xc4201b0bf1, 0xc4201b0be0)
    /usr/local/go/src/os/file_unix.go:249 +0x78
os.(_File).Write(0xc420028010, 0xc4201c01c0, 0x2f, 0x40, 0x6, 0x6, 0xc4201b0be0)
    /usr/local/go/src/os/file.go:142 +0x5f
fmt.Fprintf(0xdf4240, 0xc420028010, 0xc4201b0be0, 0x12, 0xc420053bf8, 0x6, 0x6, 0x8df601, 0xc4201adc10, 0xc420053ab0)
    /usr/local/go/src/fmt/print.go:182 +0xa9
github.com/labstack/gommon/log.(_Logger).Printf(0xc420059620, 0x992e11, 0x11, 0xc420053bf8, 0x6, 0x6)
    /home/vagrant/fsAdventCalendar/src/github.com/labstack/gommon/log/log.go:116 +0x112
gopkg.in/labstack/echo.v1/middleware.Logger.func1.1(0xc420073480, 0xc4201ad9f0, 0x3)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/middleware/logger.go:55 +0x4e3
gopkg.in/labstack/echo%2ev1.(_Echo).ServeHTTP(0xc420015860, 0xdf8400, 0xc42011b6c0, 0xc4200bc5a0)
    /home/vagrant/fsAdventCalendar/src/gopkg.in/labstack/echo.v1/echo.go:557 +0x1ca
net/http.serverHandler.ServeHTTP(0xc420073080, 0xdf8400, 0xc42011b6c0, 0xc4200bc5a0)
    /usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(_conn).serve(0xc420073100, 0xdf8e40, 0xc42001bd40)
    /usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(_Server).Serve
    /usr/local/go/src/net/http/server.go:2293 +0x44d```
olebedev commented 7 years ago

@gameiro9k, have a look at this #68