ngrosc opened a new issue #5685:
URL: https://github.com/apache/cloudstack/issues/5685
<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and main branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete
the comments.
-->
##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
* Bug Report
##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
DB
~~~
##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on main
branch.
-->
~~~
4.14.1 => 4.15.2
~~~
##### CONFIGURATION
<!--
Information about the configuration if relevant, e.g. basic network,
advanced networking, etc. N/A otherwise
-->
- existing entry in guest_os with id 305
- upgrading vom 4.14.1 to 4.15.2
##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->
N/A
##### SUMMARY
<!-- Explain the problem/feature briefly -->
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
<!--
For bugs, show exactly how to reproduce the problem, using a minimal
test-case. Use Screenshots if accurate.
For new features, show how the feature would be used.
-->
<!-- Paste example playbooks or commands between quotes below -->
~~~
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;
~~~
<!-- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
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
<!-- What actually happened? -->
<!-- Paste verbatim command output between quotes below -->
~~~
script fails with sql error concerning duplicate entry with id 305
~~~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]