getDiagnosticsData fails: www-data cannot mkdir /var/www/html/userdata on SSVM (Permission denied)

Đang mở
#13,959 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
cloud, infrastructure

Hướng nghiên cứu

Bắt đầu với các dòng 277-291 của UploadManagerImpl.java và tái hiện getDiagnosticsData trên một system VM đang chạy bằng lệnh trong issue. Kiểm tra cách template SSVM tạo và thiết lập quyền cho /var/www/html/userdata, bao gồm các đường dẫn extractVolume và extractTemplate liên quan. Hoàn tất khi async job thành công và trả về một download URL có thể sử dụng mà không cần workaround thủ công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

component:healthcheck Severity:Critical

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.0 template, not customized
  • KVM hypervisors, NFS secondary storage

The steps to reproduce the bug

  1. Run getDiagnosticsData against a running system VM, e.g. cmk get diagnosticsdata targetid=<CPVM uuid> files=/var/log/cloud.log.
  2. Wait for the async job to complete.
  3. 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).

Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
7 ngày 5 giờ
Pull request đã merge (30 ngày)
28

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/cloudstack

Tất cả issue của apache/cloudstack

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.