Project

General

Profile

Actions

Bug #17774

closed

Duplicate category name error when saving a new user technique

Added by François ARMAND over 4 years ago. Updated over 4 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Very Small
Priority:
69
Name check:
To do
Fix check:
To do
Regression:

Description

Coming from a very old rudder, in rudder 6.1 when we try to create a new user technique, we get an error:

[2020-06-17 14:29:26] ERROR com.normation.rudder.services.policies.TechniqueAcceptationUpdater - Error when trying to create to hierarchy of categories into which the new technique should be added: Consistancy: A category with that name already exists in that category: category names must be unique for a given level
[2020-06-17 14:29:26] INFO  com.normation.rudder.services.policies.TechniqueAcceptationUpdater - Automatically adding technique 'normation_com_wildcard_certificate' in category 'Root of active techniques's library (Active Techniques)' of active techniques library

This seems to be a consequence of #15575 (so from rudder 5.0.13).
The culprit looks like:

    def findCategory(sourcesCatNames: List[CategoryInfo], existings: FullActiveTechniqueCategory): (ActiveTechniqueCategoryId, String) = {
      if(sourcesCatNames.isEmpty ) (existings.id, existings.name)
      else {
        val catId = sourcesCatNames.head.id.trim
        existings.subCategories.find { cat => cat.id.value == catId} match {
          case None =>
            //create and go deeper
            createCategories(sourcesCatNames.map(x => CategoryInfo(x.id, x.name, x.description)), (existings.id, existings.name))
          case Some(cat) =>
            // continue !
            findCategory(sourcesCatNames.tail, cat)
        }
      }
    }

==> we don't check for name existance before attempting to create the new category.


Files


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #17862: error when importing techniques and running reload-techniques in 6.1RejectedActions
Related to Rudder - Bug #18010: Users techniques are not created under any technique category when customed categories were usedRejectedActions
Actions #1

Updated by François ARMAND over 4 years ago

  • Subject changed from Duplicate category name erro when saving a new user technique to Duplicate category name error when saving a new user technique
Actions #2

Updated by François ARMAND over 4 years ago

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Infrequent - complex configurations | third party integrations
  • Effort required set to Very Small
  • Priority changed from 0 to 70

It should only happens for people whose active category id are not the default ones, so before very old rudder.

Actions #3

Updated by François ARMAND over 4 years ago

  • Status changed from New to In progress
Actions #5

Updated by François ARMAND over 4 years 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/3082
Actions #6

Updated by François ARMAND over 4 years ago

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

Updated by François ARMAND over 4 years ago

  • Related to Bug #17862: error when importing techniques and running reload-techniques in 6.1 added
Actions #8

Updated by Vincent MEMBRÉ over 4 years ago

  • Related to Bug #18010: Users techniques are not created under any technique category when customed categories were used added
Actions #9

Updated by Vincent MEMBRÉ over 4 years ago

  • Status changed from Pending release to Released
  • Priority changed from 70 to 69

This bug has been fixed in Rudder 5.0.18 and 6.1.2 which were released today.

Actions

Also available in: Atom PDF