Bug #24013
openCannot import via API an archive made from an UI export of an archive via API
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
Updated by Vincent MEMBRÉ 10 months ago
- Target version changed from 8.0.5 to 8.0.6
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 8.0.6 to 8.0.7
Updated by Michel BOUISSOU 9 months ago
- Related to Bug #24294: API Import does not reload imported techniques before importing elements that rely on them added
Updated by Vincent MEMBRÉ 8 months ago
- Target version changed from 8.0.7 to 8.0.8
Updated by Vincent MEMBRÉ 7 months ago
- Target version changed from 8.0.8 to 8.0.9
Updated by Vincent MEMBRÉ 6 months ago
- Target version changed from 8.0.9 to 8.0.10
Updated by Vincent MEMBRÉ 5 months ago
- Target version changed from 8.0.10 to 1089
Updated by Alexis Mousset 4 months ago
- Target version changed from 1089 to 8.1.6
Updated by Vincent MEMBRÉ 4 months ago
- Target version changed from 8.1.6 to 8.1.7
Updated by François ARMAND 2 months ago
- Subject changed from Cannot import via API an archive made from an export of an archive via API to Cannot import via API an archive made from an UI export of an archive via API
- Assignee set to François ARMAND
We need to rename "archive" in the UI to "git export". Need to be second check.
Updated by François ARMAND 2 months ago
- File clipboard-202409191505-vsefa.png clipboard-202409191505-vsefa.png added
- Description updated (diff)
Updated by François ARMAND 2 months ago
- File clipboard-202409191510-dw8wa.png clipboard-202409191510-dw8wa.png added
- Description updated (diff)
Updated by Vincent MEMBRÉ 2 months ago
- Target version changed from 8.1.7 to 8.1.8
Updated by Vincent MEMBRÉ 14 days ago
- Target version changed from 8.1.8 to 8.1.9