Fetching logs fail if pod has more than one container

未关闭
#425 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, kubernetes
领域
api, backend

调研方向

首先跟踪请求 pod 日志的 API endpoint,以 issue 中的 Kubernetes request 和 stack trace 作为入口。检查 service name 和 container name 的传递方式,然后验证多容器 pod 是否返回日志,而不是返回 500 响应;在 GUI 中选择 container 则需要进一步调查。

由索引模型根据 Issue 内容生成。

描述

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)
主要语言
Java
星标
34
派生
34
平均合并
9 分钟
30 天内合并 PR
4

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

InseeFrLab/onyxia-api 的其他 Issue

查看 InseeFrLab/onyxia-api 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。