Failed to encode json:unsupported value

This looks the same or similar to Consoleapi storagenode: json: unsupported value: +Inf. At least, the error happens on the same line.

I will see if I can simulate it in a unit test.

I can confirm that division by zero in floats can produce NaN, +Inf, -Inf.
https://play.golang.com/p/9jDjcvCwmaq

And these are invalid JSON values.

Looking at the code, I found only one division operation that may cause this, and a zero check has already been added for v1.73, which will be rolled out soon.

4 Likes