getDiagnosticsData fails: www-data cannot mkdir /var/www/html/userdata on SSVM (Permission denied)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- java
- 领域
- cloud, infrastructure
调研方向
从 UploadManagerImpl.java 的第 277-291 行开始,使用 issue 中的命令,在正在运行的系统 VM 上复现 getDiagnosticsData。检查 SSVM 模板如何创建 /var/www/html/userdata 并设置其权限,包括相关的 extractVolume 和 extractTemplate 路径。异步任务成功并返回可用的下载 URL,且无需手动变通方案,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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).
- 主要语言
- Java
- 星标
- 3.1k
- 派生
- 1.4k
- 平均合并
- 7 天 5 小时
- 30 天内合并 PR
- 28
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/cloudstack 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
apache/cloudstack#14222 ·
-
bug component:kubernetes
难度 1/5 1 小时以内 新手友好度 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
难度 1/5 1 小时以内 新手友好度 88/100
apache/cloudstack#14070 · 5 条评论 ·
-
component:backup
难度 2/5 1-3 小时 新手友好度 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 未关闭bug component:ceph
难度 2/5 1-3 小时 新手友好度 78/100
apache/cloudstack#13989 · 3 条评论 ·
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
1.0.0-alpha2 Type/Improvement
难度 2/5 1-3 小时 新手友好度 68/100
wso2/dpdp-accelerator#272 ·
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
apache/rocketmq-dashboard#4860 · 1 条评论 ·
-
agent-audit bug
难度 2/5 1-3 小时 新手友好度 88/100
Vault-Web/cloud-page#144 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
infinispan/infinispan#18150 ·