mikekonan / exchange-proxy

exchange-proxy
GNU General Public License v3.0
110 stars 32 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #41

Closed lsalsich closed 1 year ago

lsalsich commented 2 years ago

I see this in the logs at least once per day. The service restarts the proxy, but it shuts down for at least a few minutes.

`Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: panic: runtime error: invalid memory address or nil pointer dereference Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x78f5aa] Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: goroutine 765 [running]: Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [github.com/mikekonan/exchange-proxy/store.(TTLCache).Get(0xc00000e2b8](http://github.com/mikekonan/exchange-proxy/store.(TTLCache).Get(0xc00000e2b8), {0xc000302fe0, 0x20}) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/mikekonan/exchange-proxy/store/ttl_cache.go:41 +0x12a Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: github.com/mikekonan/exchange-proxy/proxy.TransparentOverCacheHandler.func1(0xc0001ed570) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/mikekonan/exchange-proxy/proxy/handler.go:52 +0x105 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: github.com/qiangxue/fasthttp-routing.(*Context).Next(0xc0001ed570) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/qiangxue/fasthttp-routing@v0.0.0-20160225050629-6ccdc2a18d87/context.go:67 +0x55 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [github.com/qiangxue/fasthttp-routing.(Router).HandleRequest(0xc000227720](http://github.com/qiangxue/fasthttp-routing.(Router).HandleRequest(0xc000227720), 0xc000bb2580) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/qiangxue/fasthttp-routing@v0.0.0-20160225050629-6ccdc2a18d87/router.go:75 +0x1d0 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [github.com/valyala/fasthttp.(Server).serveConn(0xc000130d80](http://github.com/valyala/fasthttp.(Server).serveConn(0xc000130d80), {0x914f48?, 0xc000010188}) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/valyala/fasthttp@v1.29.0/server.go:2251 +0x1167 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [github.com/valyala/fasthttp.(workerPool).workerFunc(0xc0003166e0](http://github.com/valyala/fasthttp.(workerPool).workerFunc(0xc0003166e0), 0xc0008f5cc0) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/valyala/fasthttp@v1.29.0/workerpool.go:223 +0xa9 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: [github.com/valyala/fasthttp.(workerPool).getCh.func1()](http://github.com/valyala/fasthttp.(workerPool).getCh.func1()) Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/valyala/fasthttp@v1.29.0/workerpool.go:195 +0x38 Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: created by github.com/valyala/fasthttp.(*workerPool).getCh Apr 17 16:55:12 ip-172-31-74-118 exchange-proxy[8069]: #011github.com/valyala/fasthttp@v1.29.0/workerpool.go:194 +0x1b0

Apr 17 16:55:22 ip-172-31-74-118 systemd[1]: kucoin_proxy.service: Scheduled restart job, restart counter is at 5.`

mikekonan commented 1 year ago

fixed in v1.3.0