rodneymo / rig-monitorv2

rig-monitor implementation in Golang
10 stars 3 forks source link

"panic: runtime error: index out of range" after network problems #55

Closed StefanOberhumer closed 6 years ago

StefanOberhumer commented 6 years ago

I think one network switch in the farm got problems (all network connections to the rigs were lost):

panic: runtime error: index out of range

goroutine 31 [running]:
go-rig-monitor/miner.(*RigConfig).LoadEthminerData(0xc420145430, 0xc420067e60, 0x8f9255)
        /Users/ramf/go/src/go-rig-monitor/miner/ethminer.go:72 +0x1edc
go-rig-monitor/miner.Monitor(0xc42024c000, 0xc420067e60)
        /Users/ramf/go/src/go-rig-monitor/miner/rig-monitor.go:46 +0x4a5
created by main.main
        /Users/ramf/go/src/go-rig-monitor/main.go:152 +0xca5
rodneymo commented 6 years ago

Could you attach a trace? if you are using linux: nohup ./grm -t > trace.txt 2>&1 &

StefanOberhumer commented 6 years ago

I'll run grm with those parameters. If I catch it again I'll inform you. For privacy reasons I would prefer to send you the trace via email ?

rodneymo commented 6 years ago

sure. rodneymo@rigmonitor.app

rodneymo commented 6 years ago

@StefanOberhumer, did you ever send me that trace?

StefanOberhumer commented 6 years ago

@rodneymo ... Ups - sorry - no. Have not logged any again - but I tried to figure it out. It seems while starting up the miner responses already to the API call but have not initialized the GPUs. So the GPU-list is empty or only a part. (eg: I specified 8 GPUs in rig-monitorv2 and the miner returns only info about 0 or 2)

Maybe you can check the length of the returned elements of the API call before accessing it via VAR[index]

rodneymo commented 6 years ago

@StefanOberhumer that should not be a problem as it doesn't expected a pre-defined number of GPUs and certainly does not assume the number of GPUs to be the number defined in the config file . Instead it counts the number of fields separated by ";". Could you send me an example?

StefanOberhumer commented 6 years ago

Will try to reproduce, closing issue till I have new news.