Skip to content

duplicate entry in guest_os when upgrading from 4.14 to 4.15 #5685

Closed

Description

@ngrosc
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

Activity

  1. added this to the 4.16.1.0 milestone on Dec 2, 2021
  2. removed their assignment
    on Jan 13, 2022
  3. DaanHoogland commented on Jan 13, 2022

    @DaanHoogland
    Contributor

    @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.

  4. DaanHoogland commented on Jan 17, 2022

    @DaanHoogland
    Contributor

    related to #3609

  5. moved this from To Do to Dev In Progress in Apache CloudStack 4.16.1on Jan 25, 2022
  6. added a commit that references this issue on Jan 31, 2022
    4905ac6
  7. moved this from Dev In Progress to Ready For Review in Apache CloudStack 4.16.1on Jan 31, 2022
  8. added a commit that references this issue on Jan 31, 2022
    718411d
  9. added a commit that references this issue on Feb 8, 2022
    2ef66ee
  10. DaanHoogland commented on Feb 10, 2022

    @DaanHoogland
    Contributor

    fixed in #5911

  11. Repository owner moved this from Ready For Review to Done in Apache CloudStack 4.16.1on Feb 10, 2022
  12. DaanHoogland commented on Feb 10, 2022

    @DaanHoogland
    Contributor

    @ngrosc please check the PR and reopen or add a new issue if there are still problems with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions