Can't list zones in Horizon if two of them last updated at the same time

Bug #1734601 reported by Alexey Dushechkin
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Designate Dashboard
Fix Released
High
Unassigned

Bug Description

When two Designate zones for a project have same serial value, no zones are visible in /project/dnszones/.

In browser's JS console there is an error:
830e26e34b64.js:1336:114
Duplicate value: {"status":"ACTIVE","masters":[],"name":"zone1.example.","links":{"self":"https://os.example.com:9001/v2/zones/dfc2f673-67f4-40be-9f6c-1d9312e1f430"},"transferred_at":null,"created_at":"2016-12-27T08:41:43.000000","pool_id":"c9001903-7c32-491b-8883-e3868796f091","updated_at":"2017-11-07T10:19:33.000000","email":"<email address hidden>","version":24,"ttl":60,"action":"NONE","attributes":{},"serial":1510049968,"project_id":"4476d37f863547f8aaf005e8b18f3d29","type":"PRIMARY","id":"dfc2f673-67f4-40be-9f6c-1d9312e1f430","description":"","_timestampId":"2017-11-07T10:19:33.0000001511524415025"}
http://errors.angularjs.org/1.5.8/ngRepeat/dupes?p0=item%20in%20items%20track%20by%20item%5Bconfig.trackId%5D&p1=2017-11-07T10%3A19%3A33.0000001511524415025&p2=%7B%22status%22%3A%22ACTIVE%22%2C%22masters%22%3A%5B%5D%2C%22name%22%3A%22zone1.example.%22%2C%22links%22%3A%7B%22self%22%3A%22https%3A%2F%2Fos.example.com%3A9001%2Fv2%2Fzones%2Fdfc2f673-67f4-40be-9f6c-1d9312e1f430%22%7D%2C%22transferred_at%22%3Anull%2C%22created_at%22%3A%222016-12-27T08%3A41%3A43.000000%22%2C%22pool_id%22%3A%22c9001903-7c32-491b-8883-e3868796f091%22%2C%22updated_at%22%3A%222017-11-07T10%3A19%3A33.000000%22%2C%22email%22%3A%22email%40example.com%22%2C%22version%22%3A24%2C%22ttl%22%3A60%2C%22action%22%3A%22NONE%22%2C%22attributes%22%3A%7B%7D%2C%22serial%22%3A1510049968%2C%22project_id%22%3A%224476d37f863547f8aaf005e8b18f3d29%22%2C%22type%22%3A%22PRIMARY%22%2C%22id%22%3A%22dfc2f673-67f4-40be-9f6c-1d9312e1f430%22%2C%22description%22%3A%22%22%2C%22_timestampId%22%3A%222017-11-07T10%3A19%3A33.0000001511524415025%22%7D
minErr/<@https://os.example.com/static/dashboard/js/830e26e34b64.js:699:8
ngRepeatAction@https://os.example.com/static/dashboard/js/830e26e34b64.js:1819:530
$watchCollectionAction@https://os.example.com/static/dashboard/js/830e26e34b64.js:1507:100
$digest@https://os.example.com/static/dashboard/js/830e26e34b64.js:1512:408
$apply@https://os.example.com/static/dashboard/js/830e26e34b64.js:1517:266
done@https://os.example.com/static/dashboard/js/830e26e34b64.js:1244:112
completeRequest@https://os.example.com/static/dashboard/js/830e26e34b64.js:1259:20
requestLoaded@https://os.example.com/static/dashboard/js/830e26e34b64.js:1253:1

Zone list:
+--------------------------------------+----------------+---------+------------+--------+--------+
| id | name | type | serial | status | action |
+--------------------------------------+----------------+---------+------------+--------+--------+
| dfc2f673-67f4-40be-9f6c-1d9312e1f430 | zone1.example. | PRIMARY | 1510049968 | ACTIVE | NONE |
| 6c4e2361-8aab-4c2a-8f25-ac1cea83bfa1 | zone2.example. | PRIMARY | 1510049968 | ACTIVE | NONE |
| 1cecbb05-456f-4e98-81c4-7bc72eedacf2 | zone3.example. | PRIMARY | 1510049969 | ACTIVE | NONE |
+--------------------------------------+----------------+---------+------------+--------+--------+

After creating fake DNS records in zones with duplicate serials via API everything went back to normal.

My guess it has something to do with static/designatedashboard/zones.html and "track-by=_timestampId" part.

Versions:
designate (4.0.1.dev13)
horizon (11.0.4.dev15)

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Reproduced on stable/pike deployment

Changed in designate-dashboard:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Arunas Grigalionis (niekosau) wrote :

same here on queens
Versions:
designate 6.0.1
horizon 13.0.1

Revision history for this message
Ingo Fischer (ingofischer82) wrote :

We found the bugfix:

In case multiple zones have the same update timestamp (updated_at) the UI did not show any zone and a JS console listed an error "Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed."
To fix it addTimestampIds needs to get the correct parameter order, i.e. pass the name of the ID column before the timestamp column name.

Bugfix (queens):
```
+diff --git a/designatedashboard/static/designatedashboard/resources/os-designate-zone/os-designate-zone.module.js b/designatedashboard/static/designatedashboard/resources/os-designate-zone/os-designate-zone.module.js
+index 3c8bf61..b8a4048 100644
+--- a/designatedashboard/static/designatedashboard/resources/os-designate-zone/os-designate-zone.module.js
++++ b/designatedashboard/static/designatedashboard/resources/os-designate-zone/os-designate-zone.module.js
+@@ -194,7 +194,7 @@
+ // listFunctions are expected to return data in "items"
+ response.data.items = response.data.zones;
+
+- util.addTimestampIds(response.data.items, 'updated_at');
++ util.addTimestampIds(response.data.items, 'id', 'updated_at');
+
+ return response;
+ });
```

Revision history for this message
Ingo Fischer (ingofischer82) wrote :
Changed in designate-dashboard:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate-dashboard pike-eol

This issue was fixed in the openstack/designate-dashboard pike-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate-dashboard queens-eol

This issue was fixed in the openstack/designate-dashboard queens-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate-dashboard rocky-eol

This issue was fixed in the openstack/designate-dashboard rocky-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate-dashboard stein-eol

This issue was fixed in the openstack/designate-dashboard stein-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.