weizhouapache commented on issue #9979:
URL: https://github.com/apache/cloudstack/issues/9979#issuecomment-2501704512

   > I have found a workaround for this issue. I took a look at the code of the 
EncryptionSecretKeyChanger class (located at 
framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java)
 and found an error in the query created at lines 656-659:
   > 
   > ```
   >         String sqlTemplateDeployAsIsDetails = "SELECT 
template_deploy_as_is_details.value " +
   >                 "FROM template_deploy_as_is_details JOIN vm_instance " +
   >                 "WHERE template_deploy_as_is_details.template_id = 
vm_instance.vm_template_id " +
   >                 "vm_instance.id = %s AND 
template_deploy_as_is_details.name = '%s' LIMIT 1";
   > ```
   > 
   > If we run the created query in MySQL CLI we get an error and that's 
because the last line shoud have a connector at the beginning (I think an 'AND' 
is needed there). After adding that connector and building ACS again, the 
migration script ended successfully.
   > 
   > The modified code I used is this:
   > 
   > ```
   >         String sqlTemplateDeployAsIsDetails = "SELECT 
template_deploy_as_is_details.value " +
   >                 "FROM template_deploy_as_is_details JOIN vm_instance " +
   >                 "WHERE template_deploy_as_is_details.template_id = 
vm_instance.vm_template_id " +
   >                 "AND vm_instance.id = %s AND 
template_deploy_as_is_details.name = '%s' LIMIT 1";
   > ```
   
   good finding @detaras 
   it should be my mistake.
   
   can you create a pull request against 4.19 branch ?


-- 
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]

Reply via email to