Project

General

Profile

Actions

Bug #14404

closed

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

Added by Janos Mattyasovszky over 5 years ago. Updated over 2 years ago.

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

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
Actions #1

Updated by Janos Mattyasovszky over 5 years ago

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

Actions #2

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
Actions #3

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.

Actions #4

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 ?

Actions #5

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.

Actions #6

Updated by Nicolas CHARLES over 5 years ago

i can totally reproduce this (on centos system also)

Actions #7

Updated by Nicolas CHARLES over 5 years ago

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

Actions #8

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

Actions #9

Updated by Nicolas CHARLES over 5 years ago

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

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
Actions #11

Updated by Rudder Quality Assistant over 5 years ago

  • Assignee changed from Alexis Mousset to Nicolas CHARLES
Actions #12

Updated by Nicolas CHARLES over 5 years ago

  • Status changed from Pending technical review to Pending release

Applied in changeset ncf:commit:71681e30283a0047b03227e30e503a58c9d2138d.

Actions #13

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.

Actions #14

Updated by Alexis Mousset over 2 years ago

  • Priority changed from 101 to 88
Actions

Also available in: Atom PDF