Title: Database encryption engine migration script fails · Issue #9979 · apache/cloudstack · GitHub
Open Graph Title: Database encryption engine migration script fails · Issue #9979 · apache/cloudstack
X Title: Database encryption engine migration script fails · Issue #9979 · apache/cloudstack
Description: ISSUE TYPE Bug Report COMPONENT NAME Database encryption engine migration script CLOUDSTACK VERSION 4.18.2.3 CONFIGURATION Database with legacy cryptographic cipher (MD5/DES) OS / ENVIRONMENT Centos 7 SUMMARY When migrating from the old ...
Open Graph Description: ISSUE TYPE Bug Report COMPONENT NAME Database encryption engine migration script CLOUDSTACK VERSION 4.18.2.3 CONFIGURATION Database with legacy cryptographic cipher (MD5/DES) OS / ENVIRONMENT Cento...
X Description: ISSUE TYPE Bug Report COMPONENT NAME Database encryption engine migration script CLOUDSTACK VERSION 4.18.2.3 CONFIGURATION Database with legacy cryptographic cipher (MD5/DES) OS / ENVIRONMENT Cento...
Opengraph URL: https://github.com/apache/cloudstack/issues/9979
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Database encryption engine migration script fails","articleBody":"##### ISSUE TYPE\r\n * Bug Report\r\n\r\n##### COMPONENT NAME\r\nDatabase encryption engine migration script\r\n\r\n\r\n##### CLOUDSTACK VERSION\r\n4.18.2.3\r\n\r\n\r\n##### CONFIGURATION\r\nDatabase with legacy cryptographic cipher (MD5/DES)\r\n\r\n\r\n##### OS / ENVIRONMENT\r\nCentos 7\r\n\r\n\r\n##### SUMMARY\r\nWhen migrating from the old database encryption scheme (MD5/DES 56-bit) to the new one (AES-GCM 256-bit) using the supplied script (/usr/bin/cloudstack-migrate-databases) from any of the managers; the migration process starts, but suddenly, when working on on the 'user_vm_deploy_as_is_details' table, we get an error and the process fails.\r\n\r\n\r\n##### STEPS TO REPRODUCE\r\n~~~\r\n# systemctl stop cloudstack-management cloudstack-usage\r\n# /usr/bin/cloudstack-migrate-databases -d oldDBKey -m oldMSKey -e newDBKey -n newMSKey -v V2\r\n...\r\n...\r\nData Migration failed. Reverting db.properties\r\n~~~\r\n\r\n\r\n##### EXPECTED RESULTS\r\nThe script should end without error. The database content is migrated using the new cipher and the configuration files are updated as needed.\r\n\r\n\r\n##### ACTUAL RESULTS\r\nThe database and configuration files remains untouched, the migration script fails with the following error:\r\n\r\n~~~\r\nUnable to update user_vm_deploy_as_is_details values due to: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'vm_instance.id = 20850 AND template_deploy_as_is_details.name = 'property-timezo' at line 1\r\nError during data migration\r\ncom.cloud.utils.exception.CloudRuntimeException: Unable to update user_vm_deploy_as_is_details values\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.throwCloudRuntimeException(EncryptionSecretKeyChanger.java:794)\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.migrateTemplateDeployAsIsDetails(EncryptionSecretKeyChanger.java:663)\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.migrateData(EncryptionSecretKeyChanger.java:485)\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.migratePropertiesAndDatabase(EncryptionSecretKeyChanger.java:343)\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.main(EncryptionSecretKeyChanger.java:142)\r\nCaused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'vm_instance.id = 20850 AND template_deploy_as_is_details.name = 'property-timezo' at line 1\r\n at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)\r\n at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)\r\n at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)\r\n at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)\r\n at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)\r\n at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)\r\n at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)\r\n at com.cloud.utils.crypt.EncryptionSecretKeyChanger.migrateTemplateDeployAsIsDetails(EncryptionSecretKeyChanger.java:649)\r\n ... 3 more\r\nData Migration failed. Reverting db.properties\r\n~~~\r\n","author":{"url":"https://github.com/detaras","@type":"Person","name":"detaras"},"datePublished":"2024-11-26T18:22:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/9979/cloudstack/issues/9979"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68298373-98cc-63bb-88c9-e393b56842bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94CE:AB404:7D5FE3:AD0C59:6A55A9C7 |
| html-safe-nonce | 08a78fed7926da85135792954ae57e63d5289ccf50296e03df5bb573452f983c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NENFOkFCNDA0OjdENUZFMzpBRDBDNTk6NkE1NUE5QzciLCJ2aXNpdG9yX2lkIjoiMTYyOTU4MzY0MjY5MDE2OTI4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 48cd5555630d276e38159399d3fe1a6debfcb12cd7e7867fbb6c38be1041ae19 |
| hovercard-subject-tag | issue:2695662757 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/9979/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f03cdd630ec16b635e97e0b272ee8c84cee08b27eca727fbf6300881ee351790/apache/cloudstack/issues/9979 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f03cdd630ec16b635e97e0b272ee8c84cee08b27eca727fbf6300881ee351790/apache/cloudstack/issues/9979 |
| og:image:alt | ISSUE TYPE Bug Report COMPONENT NAME Database encryption engine migration script CLOUDSTACK VERSION 4.18.2.3 CONFIGURATION Database with legacy cryptographic cipher (MD5/DES) OS / ENVIRONMENT Cento... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | detaras |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653fccf1e27344851c0d3de3fa6faa526197f072 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width