Actions
Bug #23655
closedImport archive does not support technique upgrade
Pull Request:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
I hate Rudder for that
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Priority:
83
Name check:
To do
Fix check:
Checked
Regression:
No
Description
I built an archive containing techniques to use and test the new import API.
The first import works perfectly. After some testing I had to modify one of the technique, re-importing an archive with the updated technique without version change fails with the following error:
2023-10-26 08:51:40+0000 ERROR api-processing - SystemError: An error occurred; cause was: java.nio.file.NoSuchFileException: /var/rudder/configuration-repository/techniques/systemSettings/misc/cis_ubuntu20_audit_srv_2/1.0 -> com.normation.rudder.rest.lift.SaveArchiveServicebyRepo.$anonfun$saveTechnique$28(ArchiveApi.scala:1153) -> com.normation.zio$ZioRuntime$.$anonfun$unsafeRun$1(ZioCommons.scala:445) -> com.normation.zio$ZioRuntime$.unsafeRun(ZioCommons.scala:445) -> com.normation.zio$ZioRuntime$.runNow(ZioCommons.scala:428) -> com.normation.zio$UnsafeRun.runNow(ZioCommons.scala:454) -> com.normation.rudder.rest.RudderJsonResponse$implicits$ToLiftResponseOne.toLiftResponseOne(RudderJsonResponse.scala:199) -> com.normation.rudder.rest.RudderJsonResponse$implicits$ToLiftResponseOne.toLiftResponseOne(RudderJsonResponse.scala:211) -> com.normation.rudder.rest.lift.ArchiveApi$Import$.process0(ArchiveApi.scala:354) -> com.normation.rudder.rest.lift.FeatureSwitch0.process0(ArchiveApi.scala:134) -> com.normation.rudder.rest.lift.LiftApiModule0.process(LiftApiDispatcher.scala:112) -> com.normation.rudder.rest.lift.LiftApiModule0.process$(LiftApiDispatcher.scala:104) -> com.normation.rudder.rest.lift.FeatureSwitch0.process(ArchiveApi.scala:117) -> com.normation.rudder.rest.lift.FeatureSwitch0.process(ArchiveApi.scala:117) -> com.normation.rudder.rest.lift.LiftApiModule.handler(LiftApiDispatcher.scala:67) -> com.normation.rudder.rest.lift.LiftApiModule.handler$(LiftApiDispatcher.scala:59) -> com.normation.rudder.rest.lift.FeatureSwitch0.handler(ArchiveApi.scala:117) -> com.normation.rudder.rest.lift.FeatureSwitch0.handler(ArchiveApi.scala:117) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$21(ApiDatastructures.scala:696) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$18(ApiDatastructures.scala:680) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$15(ApiDatastructures.scala:674) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$15$adapted(ApiDatastructures.scala:672) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$13(ApiDatastructures.scala:672) -> com.normation.rudder.rest.BuildHandler.$anonfun$buildApi$7(ApiDatastructures.scala:665)The import did wipe all previous technique files in the /var/rudder/configuration-repository but did not commit the change nor did it unpack the new files from the archive in-place.
The error is very confusing as the archive is well construct and I was finally able to import it after:
- removing all directives based on techniques from the archive
- removing all techniques from the initial import in the technique tree
- removing from the confiiguration repository all the files from the initial import
- re-run the import on the updated archive
I am not sure on how the import is expected to behave, but this is very confusing for the end user and make the import/export usage very limited...
Actions