Bug 1467348

Summary: Name has Already been taken error when editing zone in Global Region
Product: Red Hat CloudForms Management Engine Reporter: Dustin Scott <dscott>
Component: ReplicationAssignee: Nick Carboni <ncarboni>
Status: CLOSED CURRENTRELEASE QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7.0CC: anewman, dajohnso, hkataria, jhardy, mpovolny, ncarboni, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: replication:distributed:zone
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1530820 (view as bug list) Environment:
Last Closed: 2018-06-21 20:45:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1530820    

Description Dustin Scott 2017-07-03 13:16:41 UTC
Description of problem:

When attempting to edit a zone in the global region (e.g. add NTP servers) an error message 'Name has already been taken appears. Presumably, this is because the zone name is the same from the remote/subordinate region.

From evm.log:

[----] I, [2017-07-03T08:05:08.388759 #24506:7c914c]  INFO -- : MIQ(MiqQueue#deliver) Message id: [99000000427481], Delivering...
[----] I, [2017-07-03T08:05:08.426091 #24506:7c914c]  INFO -- : MIQ(MiqQueue#delivered) Message id: [99000000427481], State: [ok], Delivered in [0.037354034]
 seconds
[----] E, [2017-07-03T08:05:09.348994 #24598:f00f28] ERROR -- : MIQ(ops_controller-zone_edit): Name has already been taken
[----] I, [2017-07-03T08:05:21.600886 #24522:7c914c]  INFO -- : MIQ(MiqScheduleWorker::Runner#do_work) Number of scheduled items to be processed: 0.
[----] I, [2017-07-03T08:05:36.603854 #24522:7c914c]  INFO -- : MIQ(MiqScheduleWorker::Runner#do_work) Number of scheduled items to be processed: 0.


From database (see same zone name UI between Global/Remote):

vmdb_production=# select id,name,description from zones;
       id       |   name   |  description
----------------+----------+---------------
 99000000000001 | default  | Default Zone
 99000000000002 | UI       | UI Zone
 10000000000006 | RHVM-DAL | RHVM DAL Zone
 10000000000001 | default  | Default Zone
 10000000000005 | RHVM-HOE | RHVM HOE Zone
 10000000000002 | UI       | UI Zone


Version-Release number of selected component (if applicable):

cfme-5.7.2.1-1.el7cf.x86_64


How reproducible:

100% with steps to reproduce below.


Steps to Reproduce:
1. Create UI Zone in Subordinate
2. Create UI Zone in Global
3. Attempt to edit UI Zone in Global by adding NTP servers

Actual results:

The zone is not saved, and an error message 'Name has already been taken' appears


Expected results:

The zone is saved with the requested changes.  The zone name can be duplicated because we are configuring the zone in a completely different region (Global).


Additional info:

Comment 3 CFME Bot 2018-01-03 19:30:54 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ca3ed83b00a1047940ac4cc205be75951041b845

commit ca3ed83b00a1047940ac4cc205be75951041b845
Author:     Nick Carboni <ncarboni>
AuthorDate: Tue Jan 2 16:21:17 2018 -0500
Commit:     Nick Carboni <ncarboni>
CommitDate: Tue Jan 2 16:21:17 2018 -0500

    Ensure that the zone name is unique only within the current region
    
    This allows for properties of a zone in the global region to be
    changed even if there is a zone with the same name in a remote region
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1467348

 app/models/zone.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 7 Brandon Dunne 2018-08-09 19:19:23 UTC
*** Bug 1498306 has been marked as a duplicate of this bug. ***