getDiagnosticsData fails: www-data cannot mkdir /var/www/html/userdata on SSVM (Permission denied)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java
- Domain
- cloud, infrastructure
Research direction
Start with UploadManagerImpl.java lines 277-291 and reproduce getDiagnosticsData against a running system VM using the command in the issue. Check how the SSVM template creates and permissions /var/www/html/userdata, including the related extractVolume and extractTemplate paths. Done means the async job succeeds and returns a usable download URL without a manual workaround.
Written by the indexing model from the issue text.
Description
problem
Retrieving diagnostics from a system VM fails. The archive is collected on the target VM, but the async job then errors and no download URL is produced:
Unable to create a link for entity at diagnostics//diagnostics_files_<timestamp>.zip on ssvm, Error in creating directory =mkdir: cannot create directory '/var/www/html/userdata/<uuid>/': Permission denied
Expected: the job succeeds and returns a usable download URL.
versions
- CloudStack 4.22.1.0 (management and agents)
- System VMs from the stock
systemvm-kvm-4.22.0template, not customized - KVM hypervisors, NFS secondary storage
The steps to reproduce the bug
- Run
getDiagnosticsDataagainst a running system VM, e.g.cmk get diagnosticsdata targetid=<CPVM uuid> files=/var/log/cloud.log. - Wait for the async job to complete.
- The job fails with errorcode 530 and the error above.
What to do about it?
The download directory is created as the www-data user (UploadManagerImpl.java#L277-L291), but the docroot on the SSVM is not writable by www-data. Shipping /var/www/html/userdata owned by www-data in the system VM template, or creating it as root and chowning, would fix it. extractVolume/extractTemplate downloads use the same directory and may be affected as well; only the diagnostics case is verified.
Workaround on a running SSVM: mkdir -p /var/www/html/userdata && chown www-data:www-data /var/www/html/userdata (lost on SSVM recreation).
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 1.4k
- Avg merge
- 6d 20h
- Merged PRs (30d)
- 27
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/cloudstack
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
bug component:kubernetes
Difficulty 1/5 Under an hour Newbie friendliness 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Difficulty 1/5 Under an hour Newbie friendliness 88/100
apache/cloudstack#14070 · 5 comments ·
-
component:backup
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Openbug component:ceph
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/cloudstack#13989 · 3 comments ·
All issues in apache/cloudstack
Similar issues
-
area/plugin
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kestra-io/plugin-kestra#190 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/rocketmq-dashboard#5064 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wso2/dpdp-accelerator#287 ·