Bug #23818
closedImport archive for an existing technique delete the previous technique
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.
Updated by François ARMAND 12 months ago
- Related to Bug #23655: Import archive does not support technique upgrade added
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.
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
Updated by Anonymous 12 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|655541e88c876eb30620b7f901ac19ecc1ead940.
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.