Project

General

Profile

Actions

Bug #23818

closed

Import archive for an existing technique delete the previous technique

Added by François ARMAND 12 months ago. Updated 11 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
No

Description

In https://issues.rudder.io/issues/23655, a bug in the import archive API was found and corrected. But is seems the root cause is not addressed, because the following behavior was observed:

- create a technique with editor
- export it via archive ; unzip archive ; modify yml ; redo zip
- import new archive.

Then:
- API says "all good"
- existing technique is deleted
- new technique is not present.


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #23655: Import archive does not support technique upgradeReleasedFrançois ARMANDActions
Actions #1

Updated by François ARMAND 12 months ago

  • Related to Bug #23655: Import archive does not support technique upgrade added
Actions #2

Updated by François ARMAND 12 months ago

  • Status changed from New to In progress
Actions #3

Updated by François ARMAND 12 months ago

Easy to reproduce with:
- create a technique ; derive a directive ; assign to a rule
- export only that technique,
- change/update technique/zip
- import => logs:

2023-11-30 15:21:34+0000 INFO  application.archive - Received a new policy archive 'archive.zip', processing
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/rules/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/groups/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/directives/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/techniques/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/techniques/ncf_techniques/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Archive 'archive.zip': found technique file ncf_techniques/test_import/1.0/technique.yml
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/techniques/ncf_techniques/test_import/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 TRACE application.archive - Directory 'archive/techniques/ncf_techniques/test_import/1.0/' in archive 'archive.zip': looking for entries
2023-11-30 15:21:34+0000 DEBUG application.archive - Processing archive 'archive.zip': techniques: 'ncf_techniques/test_import/1.0'
2023-11-30 15:21:34+0000 DEBUG application.archive - Processing archive 'archive.zip': directives: ''
2023-11-30 15:21:34+0000 DEBUG application.archive - Processing archive 'archive.zip': groups: ''
2023-11-30 15:21:34+0000 DEBUG application.archive - Processing archive 'archive.zip': rules: ''
2023-11-30 15:21:34+0000 DEBUG application.archive - Adding technique from archive: 'test_import' (/var/rudder/configuration-repository/techniques/ncf_techniques/test_import/1.0)
2023-11-30 15:21:34+0000 TRACE application.archive - Deleting technique files for technique 'test_import/1.0': technique.cf, technique.ps1, metadata.xml
2023-11-30 15:21:34+0000 TRACE application.archive - Writing for commit files for technique 'test_import/1.0': technique.yml
2023-11-30 15:21:36+0000 INFO  techniques.reader - Reloading technique library, found modified technique(s): ['test_import': deleted (1.0)]
2023-11-30 15:21:36+0000 WARN  application - Technique 'test_import' (1.0)' is deleted but an active technique is still present in tree: disabling it.
2023-11-30 15:21:36+0000 INFO  com.normation.rudder.services.policies.DeployOnTechniqueCallback - Update Technique library after import of and archive
2023-11-30 15:21:36+0000 INFO  policy.generation - Start policy generation, checking updated rules
2023-11-30 15:21:36+0000 ERROR application.archive - Error when processing uploaded archive: An error occurred during technique update after import of archive; cause was: Unexpected: Inconsistency: Error when looking for technique with ID 'test_import/1.0'. Check technique name and version
2023-11-30 15:21:36+0000 ERROR api-processing - An error occurred during technique update after import of archive; cause was: Unexpected: Inconsistency: Error when looking for technique with ID 'test_import/1.0'. Check technique name and version

After, the content of /var/rudder/configuration-repository/techniques/ncf_techniques/test_import/1.0 is:

- technique.yml

And the git status is clean.

So the problem is that the generation didn't trigger for that technique, everything else is OK.
The error message " An error occurred during technique update after import of archive; cause was: Unexpected: Inconsistency: Error when looking for technique with ID 'test_import/1.0'. Check technique name and version" is misleading: the reality is that the metadata.xml is missing because it was not generated, not because the technique is missing.

Actions #4

Updated by François ARMAND 12 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Clark ANDRIANASOLO
  • Pull Request set to https://github.com/Normation/rudder/pull/5224
Actions #5

Updated by Anonymous 12 months ago

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

Updated by Félix DALLIDET 12 months ago

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

Updated by Vincent MEMBRÉ 11 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 8.0.4 which was released today.

Actions

Also available in: Atom PDF