Bug #14404
closedReporting fails on NCF when service start/stop is guarded by a class
Description
On 4.1.20 on SLES11:
I have an NCF methods that starts/stops a service (lldpd) based on the presence/absence of a class.
There is a group-based class the node either belongs to or does not belong to:
# cf-promises --show-classes | grep lld group_lldpd_enabled source=promise,inventory,attribute_name=rudder_groups
There is an NCF Method that consists of starting+enabling or stopping+disabling the service depending on the class:
bundle agent service_test { vars: "class_prefix" string => canonify(join("_", "this.callers_promisers")); methods: "method_call" usebundle => service_ensure_started_at_boot("lldpd"), ifvarclass => concat("any.(group_lldpd_enabled)"); "method_call" usebundle => service_ensure_running("lldpd"), ifvarclass => concat("any.(group_lldpd_enabled)"); "method_call" usebundle => service_ensure_stopped("lldpd"), ifvarclass => concat("any.(!group_lldpd_enabled)"); "method_call" usebundle => service_ensure_disabled_at_boot("lldpd"), ifvarclass => concat("any.(!group_lldpd_enabled)"); }
Same in NCF:
Now depending on the class, one half of those 4 promises are always missing reports:
Is this by design, a bug, or just user error?
Files
Updated by Janos Mattyasovszky over 5 years ago
It is practically failing to report those that have a class condition?
Updated by François ARMAND over 5 years ago
- Translation missing: en.field_tag_list set to Sponsored
- Category set to Web - Technique editor
- Target version set to 4.1.21
- Severity set to Major - prevents use of part of Rudder | no simple workaround
- User visibility set to Getting started - demo | first install | Technique editor and level 1 Techniques
- Priority changed from 0 to 102
Updated by François ARMAND over 5 years ago
When a condition is set but the condition is not met, it should report "N/A". We will investigate that.
Updated by Nicolas CHARLES over 5 years ago
Just to be sure, this is a node where service lldpd is installed, and class is defined, am I correct ?
Updated by Janos Mattyasovszky over 5 years ago
Yes, the host is a SLES11 Host which has /etc/init.d/lldpd
.
I added a wall
to the init script, it gets executed and used correctly, and is actually enabled+started or disabled+stopped properly/
The only thing I have seen is that if the class is not defined and the method is not executed, it does not generate the N/A
reports, and it gets reported as Missing.
If the class is defined (because the node is member of the group, the methods that are supposed to run if it is not being defined are missing the NA,
If the class is not defined (because the node is not member of the group), the methods that are supposed to run if it is defined are missing the NA.
Updated by Nicolas CHARLES over 5 years ago
i can totally reproduce this (on centos system also)
Updated by Nicolas CHARLES over 5 years ago
this happens with any time of condition in 4.1 - 5.0 works as expected
Updated by Nicolas CHARLES over 5 years ago
underlying issue is that we generate a rudder_reporting.cf file with empty args - so it skips the call to rudder_reporting because of
Skipping iteration since variable 'args' resolves to an empty list
adding a value in args solves the issue, but we should also detect for empty args, and put a dummy value there
Updated by Nicolas CHARLES over 5 years ago
- Status changed from New to In progress
- Assignee set to Nicolas CHARLES
Updated by Nicolas CHARLES over 5 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Nicolas CHARLES to Alexis Mousset
- Pull Request set to https://github.com/Normation/ncf/pull/933
Updated by Rudder Quality Assistant over 5 years ago
- Assignee changed from Alexis Mousset to Nicolas CHARLES
Updated by Nicolas CHARLES over 5 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset ncf:commit:71681e30283a0047b03227e30e503a58c9d2138d.
Updated by Vincent MEMBRÉ over 5 years ago
- Status changed from Pending release to Released
- Priority changed from 102 to 101
This bug has been fixed in Rudder 4.1.21, 4.3.11 and 5.0.9 which were released today.