Repository navigation
duplicate entry in guest_os when upgrading from 4.14 to 4.15 #5685
Copy link
Copy link
Closed
Milestone
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
DB
CLOUDSTACK VERSION
4.14.1 => 4.15.2
CONFIGURATION
- existing entry in guest_os with id 305
- upgrading vom 4.14.1 to 4.15.2
OS / ENVIRONMENT
N/A
SUMMARY
When upgrading from 4.14.1 to 4.15.2 and from whatever reason a entry with id 305 in guest os exist, the db schema upgrading script fails
STEPS TO REPRODUCE
restarting the management server after the packet upgrade fails with error "duplicate entry with id 305...". removing the entry and setting autoincrement back to 305 allows a successful migration
mysql> select * from guest_os_hypervisor where guest_os_id = 305;
+-------+-----------------+---------------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
| id | hypervisor_type | guest_os_name | guest_os_id | hypervisor_version | uuid | created | removed | is_user_defined |
+-------+-----------------+---------------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
| 12345 | VMware | other3xLinux64Guest | 305 | 6.5 | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | 2020-08-22 19:44:35 | NULL | 1 |
+-------+-----------------+---------------------+-------------+--------------------+--------------------------------------+---------------------+---------+-----------------+
mysql> select * from guest_os where id = 305;
+-----+-------------+------+--------------------------------------+--------------------------+---------------------+---------+-----------------+
| id | category_id | name | uuid | display_name | created | removed | is_user_defined |
+-----+-------------+------+--------------------------------------+--------------------------+---------------------+---------+-----------------+
| 305 | 7 | NULL | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | Other 3.x Linux (64-bit) | 2020-08-22 21:43:15 | NULL | 1 |
+-----+-------------+------+--------------------------------------+--------------------------+---------------------+---------+-----------------+
mysql> delete from guest_os_hypervisor where id = 12345;
mysql> delete from guest_os where id = 305;
mysql> ALTER TABLE guest_os AUTO_INCREMENT=305;
EXPECTED RESULTS
newly created entry should not have an id set, it should use autoincrement
newly created entry should not have an id set, it should use autoincrement
ACTUAL RESULTS
script fails with sql error concerning duplicate entry with id 305
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
DaanHoogland commentedon Jan 13, 2022
@sureshanaparti this is a known issue with the way we register guest osses. I think some work is underway on this but for this particular issue or this minor release the solution is to delete the old entry and re-add it afterwards.
DaanHoogland commentedon Jan 17, 2022
related to #3609
Improve the guest OS hypervisor mappings addition on upgrade.
Improve the guest OS hypervisor mappings addition on upgrade.
Improve the guest OS hypervisor mappings addition on upgrade.
DaanHoogland commentedon Feb 10, 2022
fixed in #5911
DaanHoogland commentedon Feb 10, 2022
@ngrosc please check the PR and reopen or add a new issue if there are still problems with this.