Fetching logs fail if pod has more than one container

Đang mở
#425 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
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, kubernetes
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu bằng cách lần theo API endpoint yêu cầu pod logs, sử dụng Kubernetes request và stack trace trong issue làm điểm bắt đầu. Kiểm tra cách service name và container name được truyền vào, sau đó xác minh rằng một pod có nhiều container trả về logs thay vì phản hồi 500; việc chọn container trong GUI sẽ cần điều tra thêm.

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

Mô tả

Expected behaviour: When you in frontend select a pod (to view logs), the logs for the main container should be displayed.

Actual behaviour: Onyxia api crash since container name is not specified, and return a 500 response. This means that the GUI just display a spinner and no logs arrive to the user.
The stack trace below are an example of the stack trace that is produced

Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [
Request processing failed: io.fabric8.kubernetes.client.KubernetesClientException: 
Failure executing: GET at: https://10.16.0.1:443/api/v1/namespaces/user-ssb/pods/vscode-python-gcsfuse-346384-0/log?pretty=false. 
Message: a container name must be specified for pod vscode-python-gcsfuse-346384-0, 
choose one of: [istio-init istio-proxy gke-gcsfuse-sidecar vscode-python-gcsfuse oauth2-proxy]. 
Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, 
message=a container name must be specified for pod vscode-python-gcsfuse-346384-0, 
choose one of: [istio-init istio-proxy gke-gcsfuse-sidecar vscode-python-gcsfuse oauth2-proxy], metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null,
additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).] with root cause

Suggested fix:

  1. Quick fix: show the logs of the container with the same name as the serivce (vscode-python-gcsfuse).
  2. Ability to select container in GUI. Even though this might be a bit to complex for some users, if sidecars are injected that the user has no knowladge of (e.g. istio, gcsfuse, oauth2-proxy)
Ngôn ngữ chính
Java
Star
34
Fork
34
Merge trung bình
9 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 InseeFrLab/onyxia-api

Tất cả issue của InseeFrLab/onyxia-api

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.