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 #1

Updated by Vincent MEMBRÉ 10 months ago

  • Target version changed from 8.0.5 to 8.0.6
Actions #2

Updated by Vincent MEMBRÉ 9 months ago

  • Target version changed from 8.0.6 to 8.0.7
Actions #3

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
Actions #4

Updated by Vincent MEMBRÉ 8 months ago

  • Target version changed from 8.0.7 to 8.0.8
Actions #5

Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 8.0.8 to 8.0.9
Actions #6

Updated by Vincent MEMBRÉ 6 months ago

  • Target version changed from 8.0.9 to 8.0.10
Actions #7

Updated by Vincent MEMBRÉ 5 months ago

  • Target version changed from 8.0.10 to 1089
Actions #8

Updated by Alexis Mousset 4 months ago

  • Target version changed from 1089 to 8.1.6
Actions #9

Updated by Vincent MEMBRÉ 4 months ago

  • Target version changed from 8.1.6 to 8.1.7
Actions #10

Updated by François ARMAND 2 months ago

  • Priority changed from N/A to 2
Actions #11

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.

Actions #13

Updated by François ARMAND 2 months ago

  • Description updated (diff)
Actions #14

Updated by François ARMAND 2 months ago

  • Description updated (diff)
Actions #15

Updated by François ARMAND 2 months ago

  • Description updated (diff)
Actions #17

Updated by Vincent MEMBRÉ 2 months ago

  • Target version changed from 8.1.7 to 8.1.8
Actions #18

Updated by Vincent MEMBRÉ 15 days ago

  • Target version changed from 8.1.8 to 8.1.9
Actions

Also available in: Atom PDF