-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError #6
Comments
Which version of the beta build are you running? The active_difficulty RPC was temporarily removed in V22.0DB15 which could have caused this error. It was subsequently added back in as deprecated in V22.0DB16 so upgrading to that version should resolve the issue. |
I'm running 22.0.0.16. |
Are you running the latest version of nano-prom? |
Just did the pip install last week and I'm not showing any upgrades available so I believe it is current. |
@argakiig Do you know what the cause might be? |
it likely has to do with the rpchost being ipv6 vs hostname or ipv4, can you try either 127.0.0.1 or localhost or ensure you have rpc listening on the expected port, also --data-path should reference the datapath of the running process, if your running a docker node, you will need to use the container path, if running natively use host path. |
Basically though the error is due to the response from rpc not being json as expected, which if host or port were incorrect would appear as such |
I've tried both 127.0.0.1 and localhost and neither worked. I've assumed that the datapath would reference the location of the ldb data file (now the rockdb database). If it's supposed to be referencing the running process where would that be located in the container? /var/lib/docker/overlay2/c251d569f10346f8b4fe58c0c44559a49af03c7fe68d6186992e809d95bd64c2/diff/usr/bin/nano_rpc |
I had the same issue with the KeyError exception being thrown and the fix was to pass the correct datapath value based on my docker setup. You can either grab this from the docker-compose file where the volume is defined or check the volume bind from the running docker container with the following command: docker inspect | grep -A1 'Binds' |
Inspect on the docker looking for the 'Binds' variable is returning "/NanoBeta:/root", but I'm still getting the error utilizing that datapath. |
OK - if the datapath is correct then I would assume an issue with RPC communication to the node. You can run a manual curl command to check directly on your node:
That should return something like the following if communication is working:
If the call fails then please verify your RPC configs in the config-rpc.toml file and make sure that you have the 'enable_control' variable set to 'true'. If all else fails you'll need to check your docker configuration to make sure that you've got the beta RPC port mapped correct to the host OS. The following example is from my docker-compose file that is working:
|
When attempting to install the pushgateway with the following command, I get the below KeyError.
nano-prom --rpchost ::1 --rpc_port 55000 --datapath /NanoBeta/NanoBeta:/root --push_gateway http://localhost:9091 --hostname nanobeta
loaded config, None
Traceback (most recent call last):
File "/usr/local/bin/nano-prom", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/nano_prom_exporter/main.py", line 70, in main
stats = statsCollection.gatherStats(rpcLatency)
File "/usr/local/lib/python3.8/dist-packages/nano_prom_exporter/nanoRPC.py", line 106, in gatherStats
stats = nanoStats(self.lastData)
File "/usr/local/lib/python3.8/dist-packages/nano_prom_exporter/nanoRPC.py", line 26, in init
self.ActiveDifficulty = collection['active_difficulty']['multiplier']
KeyError: 'active_difficulty'
The text was updated successfully, but these errors were encountered: