Project

General

Profile

Bug #14404

Reporting fails on NCF when service start/stop is guarded by a class

Added by Janos Mattyasovszky 7 months ago. Updated 5 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Technique editor
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Priority:
101
Tags:

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

rudder_lldp.png (77.6 KB) rudder_lldp.png Janos Mattyasovszky, 2019-03-01 21:31
rudder_lldp_ncf.png (29.5 KB) rudder_lldp_ncf.png Janos Mattyasovszky, 2019-03-01 21:32

Associated revisions

Revision 71681e30 (diff)
Added by Nicolas CHARLES 7 months ago

Fixes #14404: Reporting fails on NCF when service start/stop is guarded by a class

History

#1

Updated by Janos Mattyasovszky 7 months ago

It is practically failing to report those that have a class condition?

#2

Updated by François ARMAND 7 months ago

  • Tags 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
#3

Updated by François ARMAND 7 months ago

When a condition is set but the condition is not met, it should report "N/A". We will investigate that.

#4

Updated by Nicolas CHARLES 7 months ago

Just to be sure, this is a node where service lldpd is installed, and class is defined, am I correct ?

#5

Updated by Janos Mattyasovszky 7 months 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.

#6

Updated by Nicolas CHARLES 7 months ago

i can totally reproduce this (on centos system also)

#7

Updated by Nicolas CHARLES 7 months ago

this happens with any time of condition in 4.1 - 5.0 works as expected

#8

Updated by Nicolas CHARLES 7 months 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

#9

Updated by Nicolas CHARLES 7 months ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
#10

Updated by Nicolas CHARLES 7 months 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
#11

Updated by Rudder Quality Assistant 7 months ago

  • Assignee changed from Alexis MOUSSET to Nicolas CHARLES
#12

Updated by Nicolas CHARLES 7 months ago

  • Status changed from Pending technical review to Pending release
#13

Updated by Vincent MEMBRÉ 5 months 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.

Also available in: Atom PDF