Project

General

Profile

Actions

Bug #24295

closed

API export of groups doesn't export the categories as dependencies

Added by Michel BOUISSOU about 2 months ago. Updated 3 days ago.

Status:
Released
Priority:
N/A
Category:
API
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
No

Description

The attached file was exported from a Rudder 8.0.4 server using :

curl --insecure --header "X-API-Token: $(cat /var/rudder/run/api-token)" "https://localhost/rudder/api/latest/archives/export?rules=212b0264-0322-49dc-844a-55d1403d5780,3350312d-b790-4c5e-ada5-3b5eeb2d354c,212b0264-0322-49dc-844a-55d1403d5780,6545e355-4f51-4dbd-ac25-14b00c1e83b0,21c06767-92f7-4ecb-a4b1-68127531eff4&groups=e8c2c43a-520d-42a5-b5da-32e72b99128d,9f0442f9-b85d-4669-bc0c-d4af7ee60205&include=all" --output lab_test_2_server_archive_240228b.zip

After having fixed the technique importation issue referenced in bug #24294, importation still fails with :

{"action":"import","result":"error","errorDetails":"Inconsistency: Entry with ID '56929488-6012-423d-849a-7103d9d63b5e' was not found"}

This UUID corresponds to a category to whic a group present in the archive file belongs, but the category was not pulled as a dependancy when creating the achive.

The archive creation should pull as dependencies the categories to which groups belong.

Also, a workaround could be considered when importing a group for which the category doesn't exist on the destination server.


Files


Subtasks 1 (0 open1 closed)

Bug #24616: Upmerge of parent leads to compilation errorReleasedVincent MEMBRÉActions

Related issues 2 (2 open0 closed)

Related to Rudder - Bug #24294: API Import does not reload imported techniques before importing elements that rely on themNewActions
Related to Rudder - Bug #24789: Archive API for import/export doesn't know about technique or rule categoriesIn progressFrançois ARMANDActions
Actions #1

Updated by Michel BOUISSOU about 2 months ago

  • Related to Bug #24294: API Import does not reload imported techniques before importing elements that rely on them added
Actions #2

Updated by François ARMAND about 2 months ago

  • Target version changed from 8.0.7 to 7.3.13

Trying to correct that in 7.3.

Actions #3

Updated by François ARMAND about 2 months ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
Actions #4

Updated by François ARMAND about 2 months ago

  • Subject changed from API export of groups doesn't export the categories as dependancies to API export of groups doesn't export the categories as dependencies
  • Description updated (diff)
Actions #5

Updated by Vincent MEMBRÉ about 2 months ago

  • Target version changed from 7.3.13 to 7.3.14
Actions #6

Updated by François ARMAND about 1 month ago

OK, so this a bit complicated. We missed the categories for groups and rules (not as important because it's a tag on rule, not the whole tree).

It's a big change: we need to rethink the directory layout to keep the same as groups for /var/rudder/config-repo.
And have a way to handle groups exported with an incorrect category. I think I will just create a category with name == uuid in that case and add them to that.

Actions #7

Updated by François ARMAND about 1 month ago

We weren't moving groups which changed categories either.

The chosen new mapping is one that match the LDAP/UI representation of group categories and groups:

archive/
 `- groups
      |- category_with_name
      |     |- category.json // the category info: uuid, name, etc
      |     `- some_group.json // the group as before
      `- some_group_under_root_category.json

This mapping is so-so, since the group serialisation also contains the group category id, so we duplicate the information, and if we move a group, it doesn't actually change its category, which is surprising. But I wanted to have the same json serialisation than the one from API.

I hesitated with a mappring like:

archive/
 |- group-categories.json // one big json will the categories 
 `- groups
      |- some_group.json // the group as before
      `- some_group_under_root_category.json

But it was strang to have a mixe of "one item for each groups" and "one big json with lots of categories".
Still, maybe it would be easier to manipulate.

Actions #8

Updated by François ARMAND about 1 month ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/5521
Actions #9

Updated by Anonymous about 1 month ago

  • Status changed from Pending technical review to Pending release
Actions #10

Updated by François ARMAND about 1 month ago

  • Subtask #24616 added
Actions #11

Updated by Vincent MEMBRÉ 28 days ago

  • Fix check changed from To do to Checked
Actions #12

Updated by François ARMAND 4 days ago

  • Related to Bug #24789: Archive API for import/export doesn't know about technique or rule categories added
Actions #13

Updated by Vincent MEMBRÉ 3 days ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 7.3.14, 8.0.8 and 8.1.1 which were released today.

Actions

Also available in: Atom PDF