Skip to content

stats not ready causes crash it seems #56

Description

@robcxyz

It seems like if the cache is not populated the service will crash?

Wait 4 days to see if this is still there as this is on initial sync - could have something to do with that.

{"level":"INFO","ts":"2025-01-25T01:38:45.863Z","caller":"api/api.go:29","msg":"GET /version"}
{"level":"INFO","ts":"2025-01-25T01:38:46.918Z","caller":"api/api.go:29","msg":"GET /api/v1/stats"}
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 131 [running]:
github.com/sudoblockio/icon-go-api/api/rest.GetMarketCap()
    /build/api/rest/stats_utils.go:76 +0x5bd
github.com/sudoblockio/icon-go-api/api/rest.UpdateMarketCap()
    /build/api/rest/stats_utils.go:90 +0x57
github.com/sudoblockio/icon-go-api/api/rest.handlerGetStats(0xc000fd6000)
    /build/api/rest/stats.go:31 +0x2a
github.com/gofiber/fiber/v2.(*App).next(0xc0006b0000, 0xc000fd6000)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/router.go:132 +0x1be
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc00001a140?)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/ctx.go:803 +0x53
github.com/gofiber/fiber/v2/middleware/compress.New.func3(0xc000fd6000)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/middleware/compress/compress.go:54 +0x45
github.com/gofiber/fiber/v2.(*Ctx).Next(0xc000fbc318?)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/ctx.go:800 +0x43
github.com/gofiber/fiber/v2/middleware/cors.New.func1(0xc000fd6000)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/middleware/cors/cors.go:141 +0x292
github.com/gofiber/fiber/v2.(*Ctx).Next(0x0?)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/ctx.go:800 +0x43
github.com/sudoblockio/icon-go-api/api.Start.func1(0xda7ec0?)
    /build/api/api.go:32 +0x126
github.com/gofiber/fiber/v2.(*App).next(0xc0006b0000, 0xc000fd6000)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/router.go:132 +0x1be
github.com/gofiber/fiber/v2.(*App).handler(0xc0006b0000, 0x4c4e37?)
    /go/pkg/mod/github.com/gofiber/fiber/v2@v2.35.0/router.go:159 +0x45
github.com/valyala/fasthttp.(*Server).serveConn(0xc0006b8000, {0x1021560?, 0xc00007a018})
    /go/pkg/mod/github.com/valyala/fasthttp@v1.38.0/server.go:2308 +0x1268
github.com/valyala/fasthttp.(*workerPool).workerFunc(0xc00074e000, 0xc000724300)
    /go/pkg/mod/github.com/valyala/fasthttp@v1.38.0/workerpool.go:224 +0xa9
github.com/valyala/fasthttp.(*workerPool).getCh.func1()
    /go/pkg/mod/github.com/valyala/fasthttp@v1.38.0/workerpool.go:196 +0x38
created by github.com/valyala/fasthttp.(*workerPool).getCh
    /go/pkg/mod/github.com/valyala/fasthttp@v1.38.0/workerpool.go:195 +0x1b0
Stream closed EOF for icon-tracker-mainnet-v2/icon-tracker-mainnet-v2-api-api-od-5df5f6c9d9-jfdhw (icon-go-api-api)

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