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.