migalabs / armiarma

Armiarma is a Libp2p open-network crawler with a current focus on Ethereum's CL network
https://monitoreth.io
MIT License
36 stars 13 forks source link

Panic error reading LastActivity from empty initialized DB #45

Closed cortze closed 1 year ago

cortze commented 1 year ago

Description

The crawler initialized a new empty DB, turned off the crawler 2 seconds after, launch it again, and the error appeared

Error Logs

ERRO[0000] unable to parse Last Activity of the tool from postgresql db: can't scan into dest[0]: cannot assign NULL to *time.Timeunable to get last activity of the tool  module=postgres-db
PANI[0000] error initializing the tables of the psqldb: unable to check existing connected peers in the postgres db  module=PEERSTORE
panic: (*logrus.Entry) 0xc000270b60

goroutine 1 [running]:
github.com/sirupsen/logrus.Entry.log({0xc00019bc70, 0xc000290780, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0}, 0x0, ...}, ...)
        /home/cortze/go/pkg/mod/github.com/sirupsen/logrus@v1.6.0/entry.go:259 +0x2de
github.com/sirupsen/logrus.(*Entry).Log(0xc000296b60, 0x0, {0xc00083d438, 0xea2f80, 0xc0002a1801})
        /home/cortze/go/pkg/mod/github.com/sirupsen/logrus@v1.6.0/entry.go:287 +0xa8
github.com/sirupsen/logrus.(*Entry).Panic(0xc0002d2230, {0xc00083d438, 0x1, 0x1})
        /home/cortze/go/pkg/mod/github.com/sirupsen/logrus@v1.6.0/entry.go:325 +0x33
github.com/migalabs/armiarma/src/db.NewPeerStore({0x13b0970, 0xc0001a8c80}, 0x0, {0xc00083d4e0, 0x4ffb25}, {0xc0001964c0, 0xed7280}, {0x13c9c50, 0xc0001fccc0})
        /home/cortze/devel/migalabs/armiarma/src/db/peerstore.go:44 +0x98
github.com/migalabs/armiarma/src/crawler.NewEth2Crawler(0xc0001a8ec0, {{0xc000264ab0, 0x10, 0x10}, 0x233c, 0x233c, {0xc000264a70, 0x10}, {0xc0001aa100, 0x5, ...}, ...})
        /home/cortze/devel/migalabs/armiarma/src/crawler/eth2_crawler.go:56 +0x13c
github.com/migalabs/armiarma/cmd.LaunchEth2Crawler(0xc00014c960)
        /home/cortze/devel/migalabs/armiarma/cmd/cmd_eth2_crawler.go:40 +0x185
github.com/urfave/cli/v2.(*Command).Run(0x1c75680, 0xc0001a8dc0)
        /home/cortze/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunContext(0xc0001dc820, {0x13b0970, 0xc0001a8c80}, {0xc00011c150, 0x3, 0x3})
        /home/cortze/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81e
main.main()
        /home/cortze/devel/migalabs/armiarma/main.go:56 +0x28c

Bug-Fix Hints

There is a log.Error() when the tool is unable to retrieve the LastActivity from the DB (here) Move that error to a warning

cortze commented 1 year ago

closing this, as it is solved in #52