Bug #21220
closedWhen upgrading to 7.1, techniques are not upgraded to the new format and reporting issue occur
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
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
Updated by Nicolas CHARLES over 2 years ago
- Description updated (diff)
- Category changed from Packaging to Techniques
Updated by Nicolas CHARLES over 2 years ago
- Target version changed from 7.1.2 to 7.0.4
Updated by Nicolas CHARLES over 2 years ago
- the json file is not updated in techniqueReader.updateTechniquesMetadataFile (which calls /usr/share/ncf/ncf write_all_techniques)
- json file of the current technique is updated via TechniqueWriter.writeTechnique(), which rewrites the technique, but doesn't read back the technique, so
- 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
Updated by Vincent MEMBRÉ over 2 years ago
- Status changed from New to In progress
- Assignee set to Vincent MEMBRÉ
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
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
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
Updated by Vincent MEMBRÉ over 2 years ago
- Assignee changed from Vincent MEMBRÉ to Nicolas CHARLES
Updated by Vincent MEMBRÉ over 2 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|f53b0e0a87cd53be3b1bfc17a053d71e2d999826.
Updated by Vincent MEMBRÉ over 2 years ago
- Fix check changed from To do to Checked
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.
Updated by François ARMAND over 2 years ago
- Related to Bug #21355: Remove unused variable newCall in JRTechniqueElem added