[GH-ISSUE #5] rr.json KeyError: 'master_node' #1

Closed
opened 2026-02-26 17:46:04 +03:00 by kerem · 8 comments
Owner

Originally created by @BerKer999 on GitHub (Jun 21, 2022).
Original GitHub issue: https://github.com/cvk98/Proxmox-load-balancer/issues/5

is rr.json missing?

Regards,

root@pve:/Proxmox-load-balancer# ./plb.py
INFO | START Load-balancer!
DEBUG | Authorization attempt...
DEBUG | Successful authentication. Response code: 200
DEBUG | init when creating a Cluster object
DEBUG | Starting Cluster.cluster_name
DEBUG | Information about the cluster name has been received. Response code: 200
DEBUG | Launching Cluster.cluster_items
DEBUG | Attempt to get information about the cluster...
DEBUG | Information about the cluster has been received. Response code: 200
DEBUG | Launching Cluster.cluster_hosts
DEBUG | Attempt to get information about the cluster HA manager...
DEBUG | Information about the cluster HA Manager has been received. Response code: 200
Traceback (most recent call last):
File "/root/Proxmox-load-balancer/./plb.py", line 468, in
main()
File "/root/Proxmox-load-balancer/./plb.py", line 439, in main
cluster = Cluster(server_url)
File "/root/Proxmox-load-balancer/./plb.py", line 84, in init
self.cl_nodes: dict = self.cluster_hosts() # All cluster nodes
File "/root/Proxmox-load-balancer/./plb.py", line 156, in cluster_hosts
self.master_node = rr.json()['data']['manager_status']['master_node']
KeyError: 'master_node'
root@pve:
/Proxmox-load-balancer# updatedb
root@pve:/Proxmox-load-balancer# locate rr.json
root@pve:
/Proxmox-load-balancer#

Originally created by @BerKer999 on GitHub (Jun 21, 2022). Original GitHub issue: https://github.com/cvk98/Proxmox-load-balancer/issues/5 is rr.json missing? Regards, root@pve:~/Proxmox-load-balancer# ./plb.py INFO | START ***Load-balancer!*** DEBUG | Authorization attempt... DEBUG | Successful authentication. Response code: 200 DEBUG | init when creating a Cluster object DEBUG | Starting Cluster.cluster_name DEBUG | Information about the cluster name has been received. Response code: 200 DEBUG | Launching Cluster.cluster_items DEBUG | Attempt to get information about the cluster... DEBUG | Information about the cluster has been received. Response code: 200 DEBUG | Launching Cluster.cluster_hosts DEBUG | Attempt to get information about the cluster HA manager... DEBUG | Information about the cluster HA Manager has been received. Response code: 200 Traceback (most recent call last): File "/root/Proxmox-load-balancer/./plb.py", line 468, in <module> main() File "/root/Proxmox-load-balancer/./plb.py", line 439, in main cluster = Cluster(server_url) File "/root/Proxmox-load-balancer/./plb.py", line 84, in __init__ self.cl_nodes: dict = self.cluster_hosts() # All cluster nodes File "/root/Proxmox-load-balancer/./plb.py", line 156, in cluster_hosts self.master_node = rr.json()['data']['manager_status']['master_node'] KeyError: 'master_node' root@pve:~/Proxmox-load-balancer# updatedb root@pve:~/Proxmox-load-balancer# locate rr.json root@pve:~/Proxmox-load-balancer#
kerem closed this issue 2026-02-26 17:46:04 +03:00
Author
Owner

@cvk98 commented on GitHub (Jun 21, 2022):

I'll try to figure it out. Maybe Cylindrical (Mark Sanford) will help. This is his code.

<!-- gh-comment-id:1162357323 --> @cvk98 commented on GitHub (Jun 21, 2022): I'll try to figure it out. Maybe Cylindrical (Mark Sanford) will help. This is his code.
Author
Owner

@cvk98 commented on GitHub (Jun 21, 2022):

Perhaps you are not using HA and the received json does not have the "master_node" key. I'll take a look later.

<!-- gh-comment-id:1162359874 --> @cvk98 commented on GitHub (Jun 21, 2022): Perhaps you are not using HA and the received json does not have the "master_node" key. I'll take a look later.
Author
Owner

@BerKer999 commented on GitHub (Jun 22, 2022):

HA setting was set to default (conditional) in Proxmox 7.2-4 not subscribe with 3 nodes

<!-- gh-comment-id:1162532417 --> @BerKer999 commented on GitHub (Jun 22, 2022): HA setting was set to default (conditional) in Proxmox 7.2-4 not subscribe with 3 nodes
Author
Owner

@cvk98 commented on GitHub (Jun 22, 2022):

Please attach the following screenshots:
image
and
image

<!-- gh-comment-id:1162755584 --> @cvk98 commented on GitHub (Jun 22, 2022): Please attach the following screenshots: ![image](https://user-images.githubusercontent.com/88323643/174971086-37fc712a-a869-4a91-aed9-dcb879cd4278.png) and ![image](https://user-images.githubusercontent.com/88323643/174971283-3881e82c-cc10-4043-bbff-1beb4f587720.png)
Author
Owner

@BerKer999 commented on GitHub (Jun 22, 2022):

Now HA manager has been configured, Thanks
pvesh is returning the msg "error resource '/cluster/ha/status/manager_status' does not define child links"
root@pve:~/Proxmox-load-balancer# ./plb.py
INFO | START Load-balancer!
DEBUG | Authorization attempt...
DEBUG | Successful authentication. Response code: 200
DEBUG | init when creating a Cluster object
DEBUG | Starting Cluster.cluster_name
DEBUG | Information about the cluster name has been received. Response code: 200
DEBUG | Launching Cluster.cluster_items
DEBUG | Attempt to get information about the cluster...
DEBUG | Information about the cluster has been received. Response code: 200
DEBUG | Launching Cluster.cluster_hosts
DEBUG | Attempt to get information about the cluster HA manager...
DEBUG | Information about the cluster HA Manager has been received. Response code: 200
DEBUG | Launching Cluster.cluster_vms
DEBUG | Launching Cluster.cluster_membership
DEBUG | Launching Cluster.cluster_cpu
INFO | This server (pve) is not the current cluster master, pve3 is. Waiting 300 seconds.

image
image

<!-- gh-comment-id:1163025275 --> @BerKer999 commented on GitHub (Jun 22, 2022): Now HA manager has been configured, Thanks pvesh is returning the msg "error resource '/cluster/ha/status/manager_status' does not define child links" root@pve:~/Proxmox-load-balancer# ./plb.py INFO | START ***Load-balancer!*** DEBUG | Authorization attempt... DEBUG | Successful authentication. Response code: 200 DEBUG | init when creating a Cluster object DEBUG | Starting Cluster.cluster_name DEBUG | Information about the cluster name has been received. Response code: 200 DEBUG | Launching Cluster.cluster_items DEBUG | Attempt to get information about the cluster... DEBUG | Information about the cluster has been received. Response code: 200 DEBUG | Launching Cluster.cluster_hosts DEBUG | Attempt to get information about the cluster HA manager... DEBUG | Information about the cluster HA Manager has been received. Response code: 200 DEBUG | Launching Cluster.cluster_vms DEBUG | Launching Cluster.cluster_membership DEBUG | Launching Cluster.cluster_cpu INFO | This server (pve) is not the current cluster master, pve3 is. Waiting 300 seconds. ![image](https://user-images.githubusercontent.com/107896589/175023937-ad77a0aa-dce9-482e-a9bf-6b8a39527384.png) ![image](https://user-images.githubusercontent.com/107896589/175024059-e78d1752-88f4-467e-bbf3-ad1fc64a4943.png)
Author
Owner

@cvk98 commented on GitHub (Jun 22, 2022):

The mode of operation only on the master node of the cluster was added only so that it was possible to roll the balancer on all nodes of the cluster. And so that they all do not start working at once - you need to include in the config a check on whether the node is the master of the HA cluster. If you have a script running on a single node or on a virtual machine, you need to install "only_on_master: OFF" in the config. This should solve your problem. And running the script in one instance only on the master node of the HA cluster with "only_on_master: ON" is pointless. Since this is not permanent and the master may change over time.

<!-- gh-comment-id:1163097581 --> @cvk98 commented on GitHub (Jun 22, 2022): The mode of operation only on the master node of the cluster was added only so that it was possible to roll the balancer on all nodes of the cluster. And so that they all do not start working at once - you need to include in the config a check on whether the node is the master of the HA cluster. If you have a script running on a single node or on a virtual machine, you need to install "only_on_master: OFF" in the config. This should solve your problem. And running the script in one instance only on the master node of the HA cluster with "only_on_master: ON" is pointless. Since this is not permanent and the master may change over time.
Author
Owner

@cvk98 commented on GitHub (Jun 24, 2022):

Can I close issue?

<!-- gh-comment-id:1165304638 --> @cvk98 commented on GitHub (Jun 24, 2022): Can I close issue?
Author
Owner

@BerKer999 commented on GitHub (Jun 24, 2022):

yes, thanks thanks for your help

<!-- gh-comment-id:1165580517 --> @BerKer999 commented on GitHub (Jun 24, 2022): yes, thanks thanks for your help
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxmox-load-balancer#1
No description provided.