Repository navigation
SSVM: entity download URL creation: ensure userdata base dir exists - #14447
DaanHoogland wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14447 +/- ##
=========================================
Coverage 18.32% 18.32%
- Complexity 16644 16647 +3
=========================================
Files 5939 5939
Lines 537768 537787 +19
Branches 65929 65932 +3
=========================================
+ Hits 98551 98555 +4
- Misses 428008 428022 +14
- Partials 11209 11210 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
Building abash -ccommand via string concatenation can introduce shell parsing/injection issues… · New This willchownthe base directory on every URL creation attempt, which can be unnecessarily… · New The error message doesn’t include the failing path (BASE_EXTRACT_PATH), which makes diagnosis… · New
What changed in this PR
Ensures SSVM download URL creation succeeds on stock templates by creating the missing /var/www/html/userdata/ base directory and making it writable by www-data before creating per-entity extract subdirectories.
Changes:
- Create the base extract directory (
BASE_EXTRACT_PATH) if missing. - Set ownership of the base extract directory to
www-data:www-databefore runningmkdiraswww-data.
| File | Description |
|---|---|
| services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/template/UploadManagerImpl.java | Ensures base extract directory exists and is owned by www-data to unblock per-entity directory creation and URL generation. |
Review effort: Lite
|
@DaanHoogland are any of the copilot comments relevant here? |
…s and is writable by www-data When handleCreateEntityURLCommand runs on the SSVM it builds the download URL by creating /var/www/html/userdata/<uuid>/ as the www-data user (su www-data -c "mkdir -p ..."). On stock systemvm templates the /var/www/html/userdata base directory does not exist and /var/www/html is not writable by www-data, so the mkdir fails with "Permission denied" and getDiagnosticsData / extractVolume / extractTemplate async jobs error out with code 530 and no download URL is produced. Fix: create the base extract directory and set its ownership to www-data before dropping privileges to create the per-entity subdirectory. This makes the SSVM self-healing on first use and matches the directory layout expected by the Apache docroot. References #13959
a926799 to
f5c2384
Compare
|
@sureshanaparti , updated. |
|
@blueorangutan package |
|
@DaanHoogland 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. |
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19949 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |






replaces #13967, as the author won't rebase
When handleCreateEntityURLCommand runs on the SSVM it builds the download URL by creating /var/www/html/userdata// as the www-data user (su www-data -c "mkdir -p ..."). On stock systemvm templates the /var/www/html/userdata base directory does not exist and /var/www/html is not writable by www-data, so the mkdir fails with "Permission denied" and getDiagnosticsData / extractVolume / extractTemplate async jobs error out with code 530 and no download URL is produced.
Fix: create the base extract directory and set its ownership to www-data before dropping privileges to create the per-entity subdirectory. This makes the SSVM self-healing on first use and matches the directory layout expected by the Apache docroot.
Fixes: #13959
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?