Improve logs, handling and parsing of Helm install erros

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

@olevitt 已经在做这个了。

开始于 2024年12月12日。

  • #534 来自 @olevitt —— 未关闭

评估

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

调研方向

从 helm-wrapper/src/main/java/io/github/inseefrlab/helmwrapper/utils/Command.java 的第 27 行开始,跟踪 helm install 的 stderr 是如何处理的,以及失败是如何到达 API logger 的。完成的标准是:真实的 Helm 错误会在正常的结构化日志流程中被捕获,而不是直接重定向到 System.err,同时通用异常输出不再是唯一有用的诊断信息。

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

描述

Currently, if the helm install fails for some reason (e.g syntax errors on generated manifests) then Onyxia-API logs a "generic" error with the Java stacktrace that contains almost no real info :
[onyxia-api-8b8497478-wdm5l] {"@timestamp":"2024-12-12T13:41:13.583714227Z","@version":"1","message":"Servlet.service() for servlet [dispatcherServlet] in context with path [\/api] threw exception","logger_name":"org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[\/api].[dispatcherServlet]","thread_name":"http-nio-8080-exec-3","level":"ERROR","level_value":40000,"stack_trace":"com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input\n at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATIONdisabled); line: 1]\n\tat com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)\n\tat com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:5008)\n\tat ... [TRIMMED FOR CLARITY]"}
and in a separate message the real helm error as emitted by the helm process :
[onyxia-api-8b8497478-wdm5l] Error: YAML parse error on argo-workflows/templates/networkpolicy-ingress.yaml: error converting YAML to JSON: yaml: line 10: did not find expected '-' indicator
This one is much more relevant and is currently redirected directly to System.err (see https://github.com/InseeFrLab/onyxia-api/blob/715cda25520e83a6e79308c0cefe837e1b1d8698/helm-wrapper/src/main/java/io/github/inseefrlab/helmwrapper/utils/Command.java#L27)
which is not properly integrated with the rest of logging system (e.g it does not use json structuring)

We should catch the real error instead of redirecting it to System.err

主要语言
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 摘要。