Bug #24013
Updated by François ARMAND 2 months ago
I exported a rules and it dependencies using <pre> curl -k -H "X-API-Token: $(cat /var/rudder/run/api-token)" 'https://127.0.0.1/rudder/api/latest/archives/export?rules=e9566965-abc9-4e6f-b474-1391196fde45&include=directives,techniques' -o archive.zip </pre> I tried to import on another system using <pre> curl -k -H "X-API-Token: $(cat /var/rudder/run/api-token)" -X POST 'https://127.0.0.1/rudder/api/latest/archives/import' --form "archive=@/vagrant/archive.zip" </pre> and it fails with <pre> {"action":"import","result":"error","errorDetails":"Inconsistency: Technique 'Telnet_Desactivation' is used in imported directive Telnet Desactivation but is not in Rudder"} </pre> webapp log says <pre> 2024-01-11 20:40:29+0000 INFO application.archive - Received a new policy archive 'archive.zip', processing 2024-01-11 20:40:31+0000 ERROR application.archive - Error when processing uploaded archive: Inconsistency: Technique 'Telnet_Desactivation' is used in imported directive Telnet Desactivation but is not in Rudder 2024-01-11 20:40:31+0000 ERROR api-processing - Inconsistency: Technique 'Telnet_Desactivation' is used in imported directive Telnet Desactivation but is not in Rudder </pre> Note: doing the import again fixes the issue Note bis: i was, before doing the proper import, trying to import an export made from Utilities/Archives to see the behaviour (it happily reported sucess, even if it did nothing meaningful) Note three: the rule categories are not exported ! Attached: the offending zip file h1. EDIT / qualification: The problem is that we are using both "archive" for API archive of configuration group/rules/etc, and archive for the old git backup export. We should either: - rename archive in the utility to "git backup" and adapt wording in UI, - or change what archive is doing to call the new API (risky, may impact existing process for clients, even is they are likely able to adapt with git commands on the server) In the UI: !clipboard-202409191505-vsefa.png! In the API: !clipboard-202409191510-dw8wa.png!