Open dutrajulio opened 2 years ago
After a lot of testing i found a workaround that, maybe, be a clue to a definitive solution.
Our ".dot" files are written in blocks where we have the "nodes declaration block" and the "linking declaration block". The final file looks like this.
graph {
"example-01" [zbx_group="Group01", zbx_label="example-01"]
"example-02" [zbx_host="example-02", zbx_label="{HOST.HOST}"]
"example-03" [zbx_host="example-03", zbx_label="{HOST.HOST}", zbx_image="Server_(64)"]
"example-01" -- "example-02" [label="link1"]
"example-01" -- "example-03"
}
The workaround was declare a node without any attributes, at last line of "nodes declaration block", before the "linking declaration block". So, the ".dot" file now looks like this.
graph {
"example-01" [zbx_group="Group01", zbx_label="example-01"]
"example-02" [zbx_host="example-02", zbx_label="{HOST.HOST}"]
"example-03" [zbx_host="example-03", zbx_label="{HOST.HOST}", zbx_image="Server_(64)"]
"REMOVETHIS"
"example-01" -- "example-02" [label="link1"]
"example-01" -- "example-03"
}
With the node "REMOVETHIS" the map is correctly generated without the error "KeyError: 'pos'".
Maybe, this is a bug related with the structure of ".dot" file we use.
Got the same problem, I'm interested to know if anyone understood the exact reason this happens and why adding a random node fixes it.
SUMMARY
zabbix_map module always return "KeyError: 'pos'" when map content have linked (-- or ->) nodes.
ISSUE TYPE
COMPONENT NAME
zabbix_map.py
ANSIBLE VERSION
CONFIGURATION
Default
OS / ENVIRONMENT / Zabbix Version
Target OS: CentOS 8 Stream Zabbix Version: 4.2.8
STEPS TO REPRODUCE
Try to create a map with linked nodes.
EXPECTED RESULTS
Map created with success.
ACTUAL RESULTS
The commando return "KeyError: 'pos'".