abh1sar opened a new pull request, #11900:
URL: https://github.com/apache/cloudstack/pull/11900

   ### Description
   
   This PR fixes #11678 
   
   #### Impact ####
   The Bug causes the backups to be not listed in the UI if the ssh.key or the 
password of the instance contain the character `=`
   
   #### Details ####
   The `backup_details` table stores vm_settings at the time of backup as a 
JSON string.
   if vm_settings contain ssh-key or password with the character such as `=` it 
is saved with html escaping as `\u003d`.
   
   This is causing an issue while generating backup response becuase 
ApiResponseSerializer.toJSONSerializedString() adds an extra escape character 
to `\u003d` and outputs it as `\=`. Json decode fails for `\=` and cmk returns 
error `failed to decode response`
   
   For the fix, I am disabling HTML escaping while setting the vmsettings json 
in the `backup_details` table.
   This is consistent with the `vm_instance_details` table where each setting 
is stored as it is, without any html escaping.
   
   **ssh-key in vm_instance:**
   <img width="1175" height="318" alt="Screenshot 2025-10-24 at 12 27 29 AM" 
src="https://github.com/user-attachments/assets/f9eef00b-1b3c-4063-9f17-45a88837ce66";
 />
   <img width="740" height="187" alt="Screenshot 2025-10-24 at 1 20 38 AM" 
src="https://github.com/user-attachments/assets/ec6406a6-085e-4062-a7c1-30cde39ddfe4";
 />
   
   **ssh-key in backup_details:**
   _1. Before fix:_
   <img width="1428" height="136" alt="Screenshot 2025-10-24 at 1 21 47 AM" 
src="https://github.com/user-attachments/assets/0d565616-7708-40f9-8ea5-7ad343dcf274";
 />
   <img width="1197" height="515" alt="Screenshot 2025-10-24 at 1 07 20 AM" 
src="https://github.com/user-attachments/assets/dab20c8f-643e-4df6-8371-7fd043f95d83";
 />
   api.log:
   <img width="1189" height="23" alt="Screenshot 2025-10-24 at 1 34 51 AM" 
src="https://github.com/user-attachments/assets/4a96fd0b-e878-4b85-ab22-3352150084fd";
 />
   
   
   _2. After fix:_
   <img width="1428" height="136" alt="Screenshot 2025-10-24 at 1 23 14 AM" 
src="https://github.com/user-attachments/assets/6499523c-17b5-4f76-a359-f51b46e6c26e";
 />
   <img width="1197" height="973" alt="Screenshot 2025-10-24 at 1 07 41 AM" 
src="https://github.com/user-attachments/assets/e7994c02-61a2-4332-bac9-d7e6897fbb66";
 />
   api.log:
   <img width="1189" height="32" alt="Screenshot 2025-10-24 at 1 33 48 AM" 
src="https://github.com/user-attachments/assets/ecf19636-2624-4166-843a-11c635e3477b";
 />
   
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally 
changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] Build/CI
   - [ ] Test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [x] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


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