retrive service error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
watcher |
Invalid
|
Undecided
|
suzhengwei |
Bug Description
In multi controller nodes, it raise exception when retrive service,
# watcher service list
Exception raised: Multiple rows were found for one() (HTTP 500)
Then I check the database,
MariaDB [watcher]> select * from services;
+------
| created_at | updated_at | deleted_at | deleted | id | name | host | last_seen_up |
+------
| 2017-10-23 09:50:14 | 2017-10-24 09:37:25 | NULL | 0 | 3 | watcher-applier | controller01 | 2017-10-24 09:37:25 |
| 2017-10-23 09:50:16 | 2017-10-24 09:37:33 | NULL | 0 | 6 | watcher-applier | controller02 | 2017-10-24 09:37:33 |
| 2017-10-23 09:50:18 | 2017-10-24 09:37:16 | NULL | 0 | 9 | watcher-applier | controller03 | 2017-10-24 09:37:16 |
| 2017-10-24 03:10:50 | 2017-10-24 09:37:27 | NULL | 0 | 12 | watcher-
| 2017-10-24 03:24:58 | 2017-10-24 09:37:35 | NULL | 0 | 15 | watcher-
| 2017-10-24 03:25:05 | 2017-10-24 09:37:17 | NULL | 0 | 18 | watcher-
+------
6 rows in set (0.00 sec)
So, I find the reason. In multi controller nodes, there would be duplicate services for watcher, and the name is not unique, so it will raise exception when calling the Watcher service APIs.
Changed in watcher: | |
assignee: | nobody → sue (sue.sam) |
description: | updated |
Changed in watcher: | |
status: | New → Invalid |