Znn_controller_dart v0.0.4 error

I’ve performed 4 node upgrades with znn_controller_dart v0.0.4 without any issues. However, Shai reported this error tonight upon upgrade. Wanted to share here.

Go installation detected: go version go1.20.3 linux/amd64

Preparing to clone go-zenon ...
znnd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=28b7a60b3e77c49496131d5b4764dc78481fc638, stripped

Unhandled exception:
NoSuchMethodError: The method 'containsKey' was called on null.
Receiver: null
Tried calling: containsKey("Index")
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38)
#1      _objectNoSuchMethod (dart:core-patch/object_patch.dart:85)
#2      _verifyProducerConfig (file:///home/runner/work/znn_controller_dart/znn_controller_dart/bin/znn_controller.dart:382)
#3      main (file:///home/runner/work/znn_controller_dart/znn_controller_dart/bin/znn_controller.dart:153)
<asynchronous suspension>
"

Getting the same error when trying to check the status (option 2)

"Unhandled exception:
NoSuchMethodError: The method 'containsKey' was called on null.
Receiver: null
Tried calling: containsKey("Index")
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38)
#1      _objectNoSuchMethod (dart:core-patch/object_patch.dart:85)
#2      _verifyProducerConfig (file:///home/runner/work/znn_controller_dart/znn_controller_dart/bin/znn_controller.dart:382)
#3      main (file:///home/runner/work/znn_controller_dart/znn_controller_dart/bin/znn_controller.dart:228)

The issue is line 382 here: znn_controller_dart/bin/znn_controller.dart at master · zenon-network/znn_controller_dart · GitHub. It assumes that config.json contains a non null producer. On my standalone node the producer was null which made this line produce an error. Should fix it to check if it is null before looking up its fields…

2 Likes

Yes, that was the problem :dart:

I think you’ve got what it takes to contribute to the source code :cowboy_hat_face: