Skip to content

Conversation

@abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Oct 23, 2025

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:
Screenshot 2025-10-24 at 12 27 29 AM
Screenshot 2025-10-24 at 1 20 38 AM

ssh-key in backup_details:
1. Before fix:
Screenshot 2025-10-24 at 1 21 47 AM
Screenshot 2025-10-24 at 1 07 20 AM
api.log:
Screenshot 2025-10-24 at 1 34 51 AM

2. After fix:
Screenshot 2025-10-24 at 1 23 14 AM
Screenshot 2025-10-24 at 1 07 41 AM
api.log:
Screenshot 2025-10-24 at 1 33 48 AM

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • 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
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  1. Created a password enabled template.
  2. Created an Instance by adding multiple SSH-keys using the password enabled template
  3. Assign to backup offering and take Backups
  4. Verified that all backups are listed properly in UI.
  5. Retried the above steps many times with different passwords and ssh-keys.

How did you try to break this feature and the system with this change?

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 23, 2025

@blueorangutan package

@blueorangutan
Copy link

@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.56%. Comparing base (b1851ba) to head (bf3f2a2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #11900   +/-   ##
=========================================
  Coverage     17.56%   17.56%           
  Complexity    15533    15533           
=========================================
  Files          5909     5909           
  Lines        529013   529014    +1     
  Branches      64605    64605           
=========================================
+ Hits          92912    92915    +3     
  Misses       425652   425652           
+ Partials      10449    10447    -2     
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.63% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15532

@abh1sar
Copy link
Collaborator Author

abh1sar commented Oct 23, 2025

@blueorangutan test

@blueorangutan
Copy link

@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging based on the author's testing results.

@harikrishna-patnala harikrishna-patnala merged commit a2fcbd6 into apache:main Oct 24, 2025
27 of 28 checks passed
@harikrishna-patnala harikrishna-patnala deleted the backup-vmsettings branch October 24, 2025 06:33
@DaanHoogland DaanHoogland added this to the 4.22.0 milestone Oct 24, 2025
@blueorangutan
Copy link

[SF] Trillian test result (tid-14716)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 71016 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11900-t14716-kvm-ol8.zip
Smoke tests completed. 148 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_enableHumanReadableLogs Error 0.38 test_human_readable_logs.py

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

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

NAS Backup & Recovery plugin: Scheduled backups are being executed but don't show up in the backup overview

5 participants