指标端点: 从文件中读取结果失败。原因: 打开结果无此文件或目录
作者: BroderPeters创建于 2026年9月28日更新于 2026年9月28日
标签bug
Description
Calling kubescape using curl -sS "http://10.0.0.77:8080/v1/metrics?skipPersistence=true&frameworks=nsa" (Calling without the frameworks parameter results in this known bug) results in the following logs in kubescape
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"requesting scan","scanID":"f8b37efb-7316-43a6-8562-bcde78ee3d24","api":"v1/metrics"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"triggering scan","scanID":"f8b37efb-7316-43a6-8562-bcde78ee3d24"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"scan triggered","ID":"f8b37efb-7316-43a6-8562-bcde78ee3d24"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Kubescape scanner initializing..."}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Initialized scanner"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loading policies..."}
{"level":"debug","ts":"2026-09-28T13:59:53Z","msg":"Downloading framework","framework":"nsa"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loaded policies"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loading exceptions..."}
{"level":"warn","ts":"2026-09-28T13:59:53Z","msg":"failed to get CRD security exceptions; continuing with primary exceptions only","error":"failed to list securityexceptions CRDs: securityexceptions.kubescape.io is forbidden: User \"system:serviceaccount:kubescape:kubescape\" cannot list resource \"securityexceptions
\" in API group \"kubescape.io\" at the cluster scope"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loaded exceptions"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loading account configurations..."}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Loaded account configurations"}
{"level":"info","ts":"2026-09-28T13:59:53Z","msg":"Accessing Kubernetes objects..."}
[...]
{"level":"info","ts":"2026-09-28T13:59:58Z","msg":"Scan results saved","filename":"results/f8b37efb-7316-43a6-8562-bcde78ee3d24.txt"}
{"level":"info","ts":"2026-09-28T13:59:58Z","msg":"skipPersistence=true, skipping storing results"}
{"level":"info","ts":"2026-09-28T13:59:58Z","msg":"done scanning","ID":"f8b37efb-7316-43a6-8562-bcde78ee3d24"}
(END)and an error code on the curl call:
{"id":"f8b37efb-7316-43a6-8562-bcde78ee3d24","type":"error","response":"failed read results from file. reason: open results/f8b37efb-7316-43a6-8562-bcde78ee3d24: no such file or directory"}
It feels like the .txt file extension is missing upon calling the results file.内容来源: kubescape/kubescape