Bug #24295
closedAPI export of groups doesn't export the categories as dependencies
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
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 François ARMAND 9 months ago
- Target version changed from 8.0.7 to 7.3.13
Trying to correct that in 7.3.
Updated by François ARMAND 9 months ago
- Status changed from New to In progress
- Assignee set to François ARMAND
Updated by François ARMAND 9 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)
Updated by Vincent MEMBRÉ 9 months ago
- Target version changed from 7.3.13 to 7.3.14
Updated by François ARMAND 8 months 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.
Updated by François ARMAND 8 months 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.
Updated by François ARMAND 8 months 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
Updated by Anonymous 8 months ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|aaea1fc522941cbac977a024c14124ca40eee9f6.
Updated by François ARMAND 7 months ago
- Related to Bug #24789: Archive API for import/export doesn't know about technique added
Updated by Vincent MEMBRÉ 7 months 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.