Skip to content

When unable to reach the DB, nothing is logged to fluentd #1

Description

@whoisjeremylam

The app just panics

2017/04/15 05:26:32 Found and using configuration file ./enuapi.json
2017/04/15 05:26:32 Reading ./enuapi.json
2017/04/15 05:26:32 Opening: tcp(localhost:3307)/vennd
2017/04/15 05:26:34 http: panic serving [::1]:51699: dial tcp [::1]:3307: connectex: No connection could be made because the target machine actively refused it.
goroutine 28 [running]:
net/http.(*conn).serve.func1(0xc0420140a0)
C:/Go/src/net/http/server.go:1721 +0xd7
panic(0x81cac0, 0xc0423f24e0)
C:/Go/src/runtime/panic.go:489 +0x2dd
github.com/vennd/enu/database.InitWithConfigPath(0x8c62a1, 0xd)
C:/Coding/go/src/github.com/vennd/enu/database/database.go:95 +0x65d
github.com/vennd/enu/database.Init()
C:/Coding/go/src/github.com/vennd/enu/database/database.go:54 +0x18a
github.com/vennd/enu/database.UserKeyExists(0xc04241a380, 0x40, 0x0)
C:/Coding/go/src/github.com/vennd/enu/database/database.go:914 +0x294
github.com/vennd/enu/handlers.CheckHeaderGeneric(0xc47f20, 0xc04240e450, 0xc475a0, 0xc0420b42a0, 0xc042422100, 0xe, 0xc04216fbc0, 0x2, 0x2)
C:/Coding/go/src/github.com/vennd/enu/handlers/handlers.go:207 +0x302
main.ctxHandler.ServeHTTP(0xa05828, 0xc475a0, 0xc0420b42a0, 0xc042422100)
C:/Coding/go/src/github.com/vennd/enu/ctxhandler.go:127 +0x44d
github.com/vennd/enu/internal/github.com/gorilla/mux.(*Router).ServeHTTP(0xc04241c1e0, 0xc475a0, 0xc0420b42a0, 0xc042422100)
C:/Coding/go/src/github.com/vennd/enu/internal/github.com/gorilla/mux/mux.go:98 +0x25c
net/http.serverHandler.ServeHTTP(0xc0420782c0, 0xc475a0, 0xc0420b42a0, 0xc042422100)
C:/Go/src/net/http/server.go:2568 +0x99
net/http.(*conn).serve(0xc0420140a0, 0xc47b20, 0xc04241a200)
C:/Go/src/net/http/server.go:1825 +0x619
created by net/http.(*Server).Serve
C:/Go/src/net/http/server.go:2668 +0x2d5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions