synfinatic / helium-analysis

Tools for hotspot placement optimization
GNU General Public License v3.0
8 stars 1 forks source link

Download breaks with panic frequently #48

Open baskinsy opened 2 years ago

baskinsy commented 2 years ago

Hello and thanks for this nice tool. I'm getting the following problem on hotspots refresh and download breaks completely. It can happen multiple times and makes it very difficult to download the hotspots db.

PANI[1514] Unable to fetch hotspots                      error="Error 503: {\"error\":\"Too Busy\"}"
panic: (*logrus.Entry) 0xc0001861c0 [recovered]
        panic: (*logrus.Entry) 0xc0001861c0

goroutine 1 [running]:
github.com/alecthomas/kong.catch(0xc008967e88)
        /home/stratos/go/pkg/mod/github.com/alecthomas/kong@v0.2.16/kong.go:383 +0xa5
panic({0x82dfe0, 0xc0001861c0})
        /usr/lib64/go/1.17/src/runtime/panic.go:1038 +0x215
github.com/sirupsen/logrus.Entry.log({0xc0000aa000, 0xc0057fa330, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, 0x0}, 0x0, ...}, ...)
        /home/stratos/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:255 +0x2b3
github.com/sirupsen/logrus.(*Entry).Log(0xc000186150, 0x0, {0xc008967480, 0x0, 0x0})
        /home/stratos/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:283 +0xa8
github.com/sirupsen/logrus.(*Entry).Logf(0xc000186150, 0x0, {0x83e0a7, 0x7cfda0}, {0x0, 0x0, 0x2})
        /home/stratos/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:329 +0x85
github.com/sirupsen/logrus.(*Entry).Panicf(...)
        /home/stratos/go/pkg/mod/github.com/sirupsen/logrus@v1.7.0/entry.go:367
main.(*HotspotsRefreshCmd).Run(0x1, 0xc00000f5f0)
        /home/stratos/Documents/Crypto/helium/helium-analysis/cmd/hotspots.go:66 +0x76
reflect.Value.call({0x7d1300, 0xc0000e2608, 0x18}, {0x8361a0, 0x4}, {0xc00000f6f8, 0x1, 0x0})
        /usr/lib64/go/1.17/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x7d1300, 0xc0000e2608, 0x10}, {0xc00000f6f8, 0x1, 0x1})
        /usr/lib64/go/1.17/src/reflect/value.go:339 +0xc5
github.com/alecthomas/kong.callMethod({0x835ea3, 0x3}, {0x7d9b40, 0xc0000e2608, 0x3}, {0x7d1300, 0xc0000e2608, 0xc0000b5dd0}, 0x53585e)
        /home/stratos/go/pkg/mod/github.com/alecthomas/kong@v0.2.16/callbacks.go:71 +0x4e7
github.com/alecthomas/kong.(*Context).RunNode(0xc000180100, 0xc00018a460, {0xc0000b5f48, 0x1, 0x1})
        /home/stratos/go/pkg/mod/github.com/alecthomas/kong@v0.2.16/context.go:706 +0x40b
github.com/alecthomas/kong.(*Context).Run(0xc0001a7714, {0xc0000b5f48, 0x1, 0x1})
        /home/stratos/go/pkg/mod/github.com/alecthomas/kong@v0.2.16/context.go:723 +0xa5
main.main()
        /home/stratos/Documents/Crypto/helium/helium-analysis/cmd/main.go:95 +0x351

Any possible solution I can try?

synfinatic commented 2 years ago

The issue is that the helium API servers are getting worse and worse.

Two quick options:

  1. Increase the retry count from 3 to a larger number: https://github.com/synfinatic/helium-analysis/blob/98c0e0d4ed80abab69719ca4dde7319f3f6f433b/analysis/helium.go#L81
  2. Try using the stakejoy API servers and see if they're better: https://github.com/synfinatic/helium-analysis/blob/98c0e0d4ed80abab69719ca4dde7319f3f6f433b/analysis/helium.go#L33

At some point I suppose these should be CLI flags, but other life priorities right now.