Icinga/icingaweb2-module-businessprocess

Leaving node after creating empty child node makes parent node inaccessible in grid view

Closed this issue · 7 comments

Describe the bug

When creating an empty child node inside a parent node and then leaving the parent node without adding content to the empty child node, the parent node itself and its parent node (so to speak, the "grandparent node" of the empty node) become inaccessible via grid view. I get the message "Undefined index: EMPTY"" in icingaweb. Any node further up is still accessible. Tree view is unaffected. Dismissing the change makes everything alright again.
If this is happening "too close" to the root of the BP, accessing it becomes difficult or impossible, if there's no other node present, since you can only access the BP by entering through another node (example in the screenshots). And since the empty child node is not yet part of the config, you can't go there to delete it.

To Reproduce

  1. Create a new node inside another node in a business process.
  2. Do not add content to the node and leave the node in which you created the empty node.
  3. Try to access the parent or grandparent node via grid view.

Expected behavior

The empty child node should simply be shown as empty in grid view, and I still want to be able to access all nodes via grid view.

Screenshots

Tree view:

grafik

Trying to access nodes "One" or "One1":

grafik

In this example "Test2" is inaccessbile by simply clicking on it, since an empty child node was created directly beneath it in the green node. Access is still possible by clicking on the purple node; this way the change which broke the BP can be dismissed. If there's no other node besides the broken one, access to the BP is completely blocked off.

grafik

Your Environment

grafik

Hi, I can't reproduce this with the steps you've shown. Please show a basic configuration with which you can.

Hey, thanks for the quick reply. This is the configuration I used to create the screenshots, redacted to remove actual server and user names:

### Business Process Config File ###
#
# Title           : Test2
# Description     : Test for Business Process Service creation.
# Owner           : -
# AddToMenu       : yes
# Statetype       : soft
# ManualOrder     : yes
#
###################################

one1 = [redacted host name];Hoststatus
display 0;one1;One1

one2 = [redacted host name];Hoststatus
display 0;one2;One2

one = one1 & one2
display 1;one;One

two1sub = [redacted host name];Hoststatus
display 0;two1sub;Two1Subb

two1 = [redacted host name];Hoststatus | [redacted host name];cluster zone | [redacted host name];Hoststatus | one2 | two1sub
display 0;two1;Two1

two2 = [redacted host name];Hoststatus | [redacted host name];Health Status | [redacted host name];M365 License Utilization | [redacted host name];Hoststatus
display 0;two2;Two2

two3 = [redacted host name];Hoststatus
display 0;two3;Two3

two = two1 & two2 & two3
display 2;two;Two

Edit: GitHub is messing some of the pasted stuff up, hope it still helps.

Hmm, still cannot reproduce it. I've added empty process nodes to all sub-processes (One1, One2, Two1, Two2, Two3) and was able to access One and Two after that perfectly fine in grid view.

Interesting, I tested it again in my environment and also created a completely new Business Process called "Test Empty", just to be sure that there weren't any weird leftovers of old configurations etc.

grafik

As you see, the node "Test One Sub2 Sub1" is empty. When at the root of "Test Empty", where I can only see the node "Test One", I cannot access this node: "Undefined index: EMPTY". Here is the config file of "Test Empty" (sorry that the IDs don't really fit the display names, I experimented around a bit with the names to find sensible ones):

### Business Process Config File ###
#
# Title           : Test Empty
# Description     : Test for empty nodes (Github issue: https://github.com/Icinga/icingaweb2-module-businessprocess/issues/330)
# Owner           : -
# AddToMenu       : yes
# Backend         :
# Statetype       : soft
#
###################################

test_one_subb2 = random_host;Hoststatus
display 0;test_one_subb2;Test One Sub1 Sub1

test_one_sub1 = random_host;Hoststatus & test_one_subb2
display 0;test_one_sub1;Test One Sub1

test_two_sub2 =
display 0;test_two_sub2;Test One Sub2 Sub1

test_one_sub2 = random_host;Hoststatus & test_two_sub2
display 0;test_one_sub2;Test One Sub2

test_one = test_one_sub1 & test_one_sub2
display 1;test_one;Test One

Works fine for me 🤷‍♂️
Screenshot from 2022-07-19 09-47-23
Screenshot from 2022-07-19 09-47-31
Screenshot from 2022-07-19 09-47-36
Screenshot from 2022-07-19 09-47-41
Screenshot from 2022-07-19 09-47-46

Aaaah, sorry, this is already fixed in the master. No wonder I cannot reproduce it.

Duplicate of #325