Project

General

Profile

Bug #5389

When two techniques generated with ncf-builder use the same generic method with same parameters, reporting cannot dinstinguish them, and reports "Unknown"

Added by Nicolas PERRON about 4 years ago. Updated over 3 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Compliance & node report
Target version:
Target version (plugin):
Severity:
User visibility:
Effort required:
Priority:

Description

If we use, in different techniques generated by ncf-builder, the same components with the same values, thenthe reporting cannot distringuih which reports should match which technique, and we get "unknown" and "no answer" states

The Techniques generated by ncf-builder have a unique name, which is also the bundle name
Rudder generates a csv file for reporting, in the format

technique_name;;class_prefix_${key};;@@RUDDER_ID@@;;component name;;component key

So far, we used only the class_prefix_${key} as a key to extract data from the this csv file, to get the line to report. Problem: we may have several time the same class_prefix_${key}, if we use in different technique the same component with same value.

Since we know the technique_name (we are calling it in the bundlesequence), we can use it in the key to search the csv file

However, we don't want to pass the technique name down the chain of generic method, as it would be clunky, so we inject it in the bundle current_technique_report_info, by calling this bundle with the current ncf technique name
And then, we change the logger_rudder to retrieve this value and expose the proper report line

This ticket part is to change the bundlesequence, to call current_technique_report_info(technique_name) before calling technique_name
It needs the modification that is in ncf in #4806 that create the bundle that stores the technique name, and update the logger_rudder to use this information


Subtasks

Bug #6171: There are no Not applicable reports anymore with ncf techniqueReleasedFrançois ARMAND
Bug #6178: generated bundlesequence contains "Bundle", making the agent non functionnalReleasedFrançois ARMAND
Bug #6163: The generated promises are invalid when there are no ncf techniquesReleasedFrançois ARMAND
Bug #6149: Update dependency between Rudder and ncfReleasedBenoît PECCATTE

Related issues

Related to Rudder - Bug #5330: When using several times a generic_method on same file with class_prefix based on filename, reports will be in "Unknown" and "No answer" statusReleased2014-07-31
Related to ncf - Bug #4797: When using multiple times the same generic method on the same object, the reporting will be broken for all of themRejected
Related to ncf - Bug #4806: When two techniques generated with ncf-builder use the same generic method with same parameters, reporting cannot dinstinguish them, and reports "Unknown"Released2014-05-02

Associated revisions

Revision 4b2f07d0 (diff)
Added by Nicolas CHARLES almost 4 years ago

Fixes #5389: define, before calling a ncf technique, which technique we'll do the reportig on

Revision 7f8dc262
Added by François ARMAND over 3 years ago

Merge pull request #67 from ncharles/bug_5389/dev/define_current_metatechnique_for_reporting

Fixes #5389: define, before calling a ncf technique, which technique we'...

History

#1 Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 2.10.5 to 2.10.6

#2 Updated by Matthieu CERDA about 4 years ago

  • Target version changed from 2.10.6 to 2.10.7

#3 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.7 to 2.10.8

#4 Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.8 to 2.10.9

#5 Updated by Nicolas CHARLES almost 4 years ago

  • Status changed from New to Pending technical review
  • Assignee changed from Nicolas CHARLES to François ARMAND
  • Pull Request set to https://github.com/Normation/cf-clerk/pull/67

#6 Updated by François ARMAND over 3 years ago

  • Status changed from Pending technical review to Discussion
  • Assignee changed from François ARMAND to Nicolas CHARLES

Could you explain the whole scheme of resolution of that one?

AFAIU, the idea is:

- to provide on the ncf side something that set a variable to the current technique to report on,
- when we generate the bundle sequence, before each ncf technique, we set the variable to the name of the technique, so that the reporting is done correctly.

Is it that ?

Also, could clearly explain in which ticket each part of the logic is implemented ?

#7 Updated by Nicolas CHARLES over 3 years ago

  • Status changed from Discussion to Pending technical review
  • Assignee changed from Nicolas CHARLES to François ARMAND

The Techniques generated by ncf-builder have a unique name, which is also the bundle name
Rudder generates a csv file for reporting, in the format

technique_name;;class_prefix_${key};;@@RUDDER_ID@@;;component name;;component key

So far, we used only the class_prefix_${key} as a key to extract data from the this csv file, to get the line to report. Problem: we may have several time the same class_prefix_${key}, if we use in different technique the same component with same value.

Since we know the technique_name (we are calling it in the bundlesequence), we can use it in the key to search the csv file

However, we don't want to pass the technique name down the chain of generic method, as it would be clunky, so we inject it in the bundle current_technique_report_info, by calling this bundle with the current ncf technique name
And then, we change the logger_rudder to retrieve this value and expose the proper report line

This ticket part is to change the bundlesequence, to call current_technique_report_info(technique_name) before calling tehcnique_name

#8 Updated by Nicolas CHARLES over 3 years ago

The other ticket is http://www.rudder-project.org/redmine/issues/4806 but i cannot link it

#9 Updated by François ARMAND over 3 years ago

OK, so could you update the title and description of both this ticket and #4806 so that:

- the actual problem is clearly stated (the current title is just a sample, it should be used in the description to illustrate what is happening with a concrete case)
- the description on both ticket looks like your last comment, which actually explain really well the problem
- the description of that tickets states something like: "this ticket need the fixes in #4806 that will use the technique name in the rudder-logger of ncf at the right place" (or actually, what is sensible :)

Thanks!

#10 Updated by Nicolas CHARLES over 3 years ago

  • Subject changed from A Directive based on a metatechnique which use the methods service_ensure_running and service_ensure_running_at_boot on the same service will be in "Unknown" state to When two techniques generated with ncf-builder use the same generic method with same parameters, reporting cannot dinstinguish them, and reports "Unknown"
  • Description updated (diff)

#11 Updated by Nicolas CHARLES over 3 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

Applied in changeset clerk:commit:4b2f07d02386bd6fd38ee27457080ce667e9c548.

#12 Updated by François ARMAND over 3 years ago

Applied in changeset clerk:commit:7f8dc262c3fe712dd3483d0566f0e4739b9cf15e.

#13 Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.10.9 to 2.10.10

#14 Updated by Vincent MEMBRÉ over 3 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.10 and 2.11.7, which were these days.

Also available in: Atom PDF