Bug #5129
closedHost Group creation may fail if Host Group with id 1 exists with same parameter name
Description
I believe the cause is similar to issue #4731. On a production RHEL or Centos install, when creating a Host Group and specifying some parameter, if a host group with ID = 1 already exists with that same parameter name the creation will fail with error "Name has already been taken". The cause is that when this validation is run:
validates :name, :uniqueness => {:scope => :reference_id}
The new parameter's reference_id is set to 1 instead of nil. Thus if a host group already exists with this parameter name (and that host group has an ID of 1), the validation will fail.
Here is an example of a validation:
GroupParameter Exists (0.2ms) SELECT 1 AS one FROM "parameters" WHERE "parameters"."type" IN ('GroupParameter') AND ("parameters"."name" = 'kt_org' AND "parameters"."reference_id" = 1) LIMIT 1
This was the sql generated with a new host group submission.
NOTE: this will not occur on a development install using the latest version of Rails 3.2.
Updated by Dominic Cleal over 10 years ago
- Category set to Database
- Status changed from New to Ready For Testing
- Target version set to 1.8.4
Updated by Dominic Cleal over 10 years ago
- Status changed from Ready For Testing to New
- Target version deleted (
1.8.4)
PR closed.
Updated by Justin Sherrill over 10 years ago
- Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1103321
Updated by Dominic Cleal over 10 years ago
- Status changed from New to Ready For Testing
- Assignee set to Joseph Magen
- Target version set to 1.8.1
Updated by Dominic Cleal over 10 years ago
- Translation missing: en.field_release set to 18
Updated by Joseph Magen over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 691f0a1a809569d125e9385e60f8f1e1c8d88061.
Updated by Dominic Cleal over 10 years ago
- Related to Bug #6375: Can't create parameters for operating system with id 1 using API added