Project

General

Profile

Actions

Bug #21220

closed

When upgrading to 7.1, techniques are not upgraded to the new format and reporting issue occur

Added by Nicolas CHARLES over 2 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
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:
70
Name check:
To do
Fix check:
Checked
Regression:

Description

at least when upgrading from 6.1, ncf_techniques are not upgraded (they dont contain the _method_reporting_context_v4 ) and so they report erraticaly

There are no errors in the logs, they says that everything is fine, it finished with

 [2022-06-08 10:31:54+0200] DEBUG bootchecks - [#8] Regenerate all ncf techniques: OK in [9 s 727 ms] ms

but file /opt/rudder/etc/force_ncf_technique_update is still present

The issue resides in the dsc writing part, because the parameters of generic method changed between 6.x and 7.x
With the attached json file, the classic migration part, but the dsc fails with the following log (that is never outputed)

Parameter 'path' for method 'file_replace_lines' not found when writing dsc Technique 'Test broken upgrade' methods calls

The related parameter passed TechniqueWriter is "file -> /etc/default/grub"

But method does not contain anymore this parameter, but the parameter "path", as hinted by the `# @parameter_rename file path
` in the description

So the writing of dsc technique does not know the the parameter rename, and fails to generate.

But it does rewrite the json correctly, and so at next restart of the webapp, it picks up the updated json file, which list "path" and not "file" as the parameter, and correctly fixes it


Files

stack (85.5 KB) stack Nicolas CHARLES, 2022-06-03 17:53

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #21355: Remove unused variable newCall in JRTechniqueElemReleasedVincent MEMBRÉActions
Actions #1

Updated by Nicolas CHARLES over 2 years ago

Actions #2

Updated by Alexis Mousset over 2 years ago

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

Updated by Nicolas CHARLES over 2 years ago

  • Description updated (diff)
  • Category changed from Packaging to Techniques
Actions #4

Updated by Nicolas CHARLES over 2 years ago

  • Target version changed from 7.1.2 to 7.0.4
Actions #5

Updated by Nicolas CHARLES over 2 years ago

There are multiples issues that seems to collide there.
  1. the json file is not updated in techniqueReader.updateTechniquesMetadataFile (which calls /usr/share/ncf/ncf write_all_techniques)
  2. json file of the current technique is updated via TechniqueWriter.writeTechnique(), which rewrites the technique, but doesn't read back the technique, so
  3. the definition used is not up to date: it looks for old method parameters rather than the new on

Plus, in classic writer, parameters not found are ignored, but it's not the case in dsc. If we ignore them in dsc, it still fails after while writing.

Easiest solution may be to reload the .json file after updating it

Actions #6

Updated by Vincent MEMBRÉ over 2 years ago

  • Status changed from New to In progress
  • Assignee set to Vincent MEMBRÉ
Actions #7

Updated by Nicolas CHARLES over 2 years ago

We can update the TechniqueEditor object by using the same method as in the serialization, and using the paramRename
However, there are still issues with "Method 'package_install_version_cmp_update_arch' not found when writing " on dsc

Actions #8

Updated by Vincent MEMBRÉ over 2 years ago

  • Assignee changed from Vincent MEMBRÉ to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/4327
Actions #9

Updated by Nicolas CHARLES over 2 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Vincent MEMBRÉ
  • Pull Request changed from https://github.com/Normation/rudder/pull/4327 to https://github.com/Normation/rudder/pull/4328
Actions #10

Updated by Vincent MEMBRÉ over 2 years ago

  • Assignee changed from Vincent MEMBRÉ to Nicolas CHARLES
Actions #11

Updated by Vincent MEMBRÉ over 2 years ago

  • Status changed from Pending technical review to Pending release
Actions #12

Updated by Vincent MEMBRÉ over 2 years ago

  • Fix check changed from To do to Checked
Actions #13

Updated by Vincent MEMBRÉ over 2 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 7.0.4 and 7.1.2 which were released today.

Actions #14

Updated by François ARMAND over 2 years ago

  • Related to Bug #21355: Remove unused variable newCall in JRTechniqueElem added
Actions

Also available in: Atom PDF