Project

General

Profile

Actions

Bug #24013

open

Cannot import via API an archive made from an UI export of an archive via API

Added by Nicolas CHARLES 11 months ago. Updated 15 days ago.

Status:
New
Priority:
2
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

I exported a rules and it dependencies using

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

I tried to import on another system using

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" 

and it fails with

{"action":"import","result":"error","errorDetails":"Inconsistency: Technique 'Telnet_Desactivation' is used in imported directive Telnet Desactivation but is not in Rudder"}

webapp log says
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

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

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:

In the API:


Files


Related issues 1 (1 open0 closed)

Related to Rudder - Bug #24294: API Import does not reload imported techniques before importing elements that rely on themNewFrançois ARMANDActions
Actions

Also available in: Atom PDF