DataHenHQ/till

Invalid memory address or nil pointer dereference

paramaw opened this issue · 1 comments

A user reported the following issue:

gotten error: Put "https://till.datahen.com/api/v1/instances/default/stats": read tcp 192.168.1.100:54493->104.21.62.154:443: read: connection reset by peer
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1028d8244]

goroutine 76 [running]:
github.com/DataHenHQ/till/server.startRecurringStatUpdate()
	/__w/till/till/server/stats.go:51 +0x194
created by github.com/DataHenHQ/till/server.Serve
	/__w/till/till/server/server.go:108 +0x3a8

After looking deeper into this, I realized that this happened during the time of deployment to the Till cloud's stats endpoint API. And when the Till instance tries to update the stats data to the endpoint, it crashes due to the stats endpoint being unavailable.

I've since fixed both things:

  1. Make the local Till instance to be more resilient to the unavailability of the Till cloud's endpoint APIs
  2. Changed Till cloud's Kubernetes' configuration so that rolling deployment would not cause a downtime