Bug #18499
closedcategory.xml is created in place of activeTechniqueSettings.xml in all config-repos/directives
Description
rollbacking a group change to after the event fails with
Rollback failed : Error when performing eventlog's rollback with id '62' <- Error when unserializing category for file 'directives/ncf_techniques/test_technique/category.xml' <- Unexpected: Entry type is not a <activeTechniqueCategory>: <activeTechnique fileFormat="6"> <id>05cefa21-ad6d-4928-9ebb-e2a4f1bec9e0</id> <techniqueName>test_technique</techniqueName> <isEnabled>true</isEnabled> <isSystem>false</isSystem> <versions> <version name="1.0">2020-11-04T15:27:29.795Z</version> </versions> </activeTechnique>
EDIT: the problem is that the category.xml
file was put at 'directives/ncf_techniques/test_technique/category.xml'
, when it shouldn't.
We need to discover why that category.xml file was put there.
Updated by François ARMAND about 4 years ago
That `category.xml` file should not be there. That name is reserved for category descriptor, and so its parsing fails.
Have a process to reach the state where you have a file /var/rudder/config-repo/directives/ncf_techniques/XXXX/category.xml
present.
Updated by François ARMAND about 4 years ago
- Subject changed from rollbacking from eventlog page fails to category.xml created by mistake in user technique directory breaks rollback
- Description updated (diff)
Updated by Nicolas CHARLES about 4 years ago
that category.xml file is created by the technique editor when creating a technique
# git show e6eaf478e7100cc351b9f1b94e9ea888cfbc4f04 commit e6eaf478e7100cc351b9f1b94e9ea888cfbc4f04 Author: admin <email not set> Date: Mon Nov 16 16:32:28 2020 +0000 Archive of technique library template for technique name 'sqfsqdfsqf' Reason provided by user: Update Technique library after creating files for ncf Technique sqfsqdfsqf diff --git a/directives/ncf_techniques/sqfsqdfsqf/category.xml b/directives/ncf_techniques/sqfsqdfsqf/category.xml new file mode 100644 index 0000000..c519e2d --- /dev/null +++ b/directives/ncf_techniques/sqfsqdfsqf/category.xml @@ -0,0 +1,9 @@ +<activeTechnique fileFormat="6"> + <id>8f254d1f-cc7e-4c21-b20d-544d9b6eafd1</id> + <techniqueName>sqfsqdfsqf</techniqueName> + <isEnabled>true</isEnabled> + <isSystem>false</isSystem> + <versions> + <version name="1.0">2020-11-16T16:32:28.054Z</version> + </versions> +</activeTechnique> \ No newline at end of file
Updated by Nicolas CHARLES about 4 years ago
When I create a technique, I have 2 commits:
commit 8d746aeeb148c4d53a528728daf812c18b6b1bff Author: admin <email not set> Date: Wed Nov 18 20:37:28 2020 +0000 Archive of technique library template for technique name 'blabliblu' Reason provided by user: Update Technique library after creating files for ncf Technique blabliblu commit d75312d77d90dc4285736d5129d6e5a1ec09e9d5 Author: admin <email not set> Date: Wed Nov 18 20:37:28 2020 +0000 Committing technique blabliblu
first commit is normal
commit d75312d77d90dc4285736d5129d6e5a1ec09e9d5 Author: admin <email not set> Date: Wed Nov 18 20:37:28 2020 +0000 Committing technique blabliblu diff --git a/techniques/ncf_techniques/blabliblu/1.0/metadata.xml b/techniques/ncf_techniques/blabliblu/1.0/metadata.xml new file mode 100644 index 0000000..6430092 --- /dev/null +++ b/techniques/ncf_techniques/blabliblu/1.0/metadata.xml @@ -0,0 +1,31 @@ +<TECHNIQUE name="blabliblu"> + <DESCRIPTION></DESCRIPTION> + <USEMETHODREPORTING>true</USEMETHODREPORTING> + <AGENT type="cfengine-community,cfengine-nova"> + <BUNDLES> + <NAME>blabliblu</NAME> + </BUNDLES> + <FILES> + <FILE name="RUDDER_CONFIGURATION_REPOSITORY/techniques/ncf_techniques/blabliblu/1.0/technique.cf"> + <INCLUDED>true</INCLUDED> + </FILE> + </FILES> + </AGENT> + <AGENT type="dsc"> + <BUNDLES> + <NAME>Blabliblu</NAME> + </BUNDLES> + <FILES> + <FILE name="RUDDER_CONFIGURATION_REPOSITORY/techniques/ncf_techniques/blabliblu/1.0/technique.ps1"> + <INCLUDED>true</INCLUDED> + </FILE> + </FILES> + </AGENT> + <SECTIONS> + <SECTION component="true" multivalued="true" name="Command execution"> + <REPORTKEYS> + <VALUE>/bin/test</VALUE> + </REPORTKEYS> + </SECTION> + </SECTIONS> +</TECHNIQUE> \ No newline at end of file diff --git a/techniques/ncf_techniques/blabliblu/1.0/technique.cf b/techniques/ncf_techniques/blabliblu/1.0/technique.cf (snip) \ No newline at end of file diff --git a/techniques/ncf_techniques/blabliblu/1.0/technique.json b/techniques/ncf_techniques/blabliblu/1.0/technique.json new file mode 100644 index 0000000..4d88103 --- /dev/null +++ b/techniques/ncf_techniques/blabliblu/1.0/technique.json @@ -0,0 +1,22 @@ +{ + "bundle_name":"blabliblu", + "version":"1.0", + "category":"ncf_techniques", + "description":"", + "name":"blabliblu", + "method_calls":[ (snip) \ No newline at end of file diff --git a/techniques/ncf_techniques/blabliblu/1.0/technique.ps1 b/techniques/ncf_techniques/blabliblu/1.0/technique.ps1 new file mode 100644 index 0000000..a0d1f78 --- /dev/null +++ b/techniques/ncf_techniques/blabliblu/1.0/technique.ps1 @@ -0,0 +1,16 @@ +<U+FEFF>function Blabliblu { + [CmdletBinding()] + param ( + [parameter(Mandatory=$true)] + [string]$reportId, + [parameter(Mandatory=$true)] + [string]$techniqueName, + [switch]$auditOnly >\ No newline at end of file
second commit is dubious
[root@server ncf_techniques]# git show 8d746aeeb148c4d53a528728daf812c18b6b1bff commit 8d746aeeb148c4d53a528728daf812c18b6b1bff Author: admin <email not set> Date: Wed Nov 18 20:37:28 2020 +0000 Archive of technique library template for technique name 'blabliblu' Reason provided by user: Update Technique library after creating files for ncf Technique blabliblu diff --git a/directives/ncf_techniques/blabliblu/category.xml b/directives/ncf_techniques/blabliblu/category.xml new file mode 100644 index 0000000..19a25ce --- /dev/null +++ b/directives/ncf_techniques/blabliblu/category.xml @@ -0,0 +1,9 @@ +<activeTechnique fileFormat="6"> + <id>28b05f7c-8d9e-4c76-bc8b-310b0525bbeb</id> + <techniqueName>blabliblu</techniqueName> + <isEnabled>true</isEnabled> + <isSystem>false</isSystem> + <versions> + <version name="1.0">2020-11-18T20:37:28.630Z</version> + </versions> +</activeTechnique> \ No newline at end of file
Updated by François ARMAND about 4 years ago
- Subject changed from category.xml created by mistake in user technique directory breaks rollback to category.xml is created in place of activeTechniqueSettings.xml in all config-repos/directives
- Priority changed from 3 to 1 (highest)
So, I misunderstood at first: the problem is not the fact that the category.xml
is created, but that it is created in place of the expected activeTechniqueSettings.xml
file.
And actually, all activeTechniqueSettings
files are named category.xml
in 6.2.0!
Updated by François ARMAND about 4 years ago
- Status changed from New to In progress
Updated by François ARMAND about 4 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/rudder/pull/3411
Updated by François ARMAND about 4 years ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|13536039b27f1a7aff15a2bf6cc820e2baf0856d.
Updated by François ARMAND about 4 years ago
- Fix check changed from To do to Checked
Updated by Vincent MEMBRÉ about 4 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 6.2.0~rc1 which was released today.