Skip to content

[Bug] Skill ZIP create returns 500 for normal-user canary upload #1195

Description

@wanghuan-520

摘要

线上普通用户执行 skill ZIP 创建接口时,POST /api/v1/skills?skip_validation=true 返回 500 internal_error。同一轮线上巡检中首页、版本端点、登录态、只读页面、network/console 检查均通过,因此不像是整站环境挂掉,更像是 skill create 路径的服务端异常。

影响

  • 普通用户无法通过 ZIP 创建 private skill canary。
  • agentic-testing 线上巡检的 same-heartbeat private canary lifecycle 被阻断:create 失败后,update / Try in Playground / audit / cleanup 按安全策略跳过,避免误操作历史 skill。
  • 当前跟踪:ChronoAIProject/agentic-testing#362

关键证据(已脱敏)

  • 环境:production https://ornn.chrono-ai.fun/
  • 账号角色:normal user,server role 为 ornn-user
  • Endpoint: POST /api/v1/skills?skip_validation=true
  • Request content type: application/zip
  • Request body: 非空 ZIP,423 bytes
  • Response content type: application/problem+json
  • Response status: 500
  • Response code: internal_error
  • Response requestId: d9deeb459701e5f33c39f3750b6f4146
  • Response instance: /api/v1/skills

响应预览(无 token/cookie/localStorage/账号密码):

{
  "title": "Server error",
  "status": 500,
  "detail": "Internal server error",
  "instance": "/api/v1/skills",
  "code": "internal_error",
  "requestId": "d9deeb459701e5f33c39f3750b6f4146"
}

复现路径

  1. 使用已登录的普通用户会话(非 admin / owner / superuser)。
  2. 发送一个非空 skill ZIP 到:
    POST /api/v1/skills?skip_validation=true
  3. Header: Content-Type: application/zip
  4. 预期:创建 private skill,返回 201 Created;如果 ZIP 内容不合法,应返回可诊断的 4xx validation / bad request。
  5. 实际:返回 500 internal_error,requestId 为 d9deeb459701e5f33c39f3750b6f4146

初步排查

  • agentic-testing 侧确认本轮 heartbeat 的 auth、readonly pages、autonomous API/UI discovery、network failures、console errors 均通过。
  • ZIP body 非空;此前一次错误探针出现过 400 empty_body,已排除为探针构造问题,不是本次 500 的证据。
  • Ornn API 路由 POST /skills 会把 request body 转为 Uint8Array 后调用 skillService.createSkill(...)skip_validation=true 只跳过格式校验,仍会执行 ZIP limits、SKILL.md/frontmatter 解析、dependency validation、storage upload、skill/version document 写入等服务端路径。
  • 本地只能看到 kind-ornn-local Kubernetes context;kubectl logs -n ornn-cluster deploy/ornn-api --since=24h 未找到该 production requestId。本 issue 提供 production response requestId,便于有线上日志权限的人继续查服务端堆栈。

安全说明

  • 未附带任何 token、cookie、localStorage、密码或账号凭据。
  • 巡检只使用普通用户。
  • create 失败后没有继续执行 update/playground/audit/cleanup mutation。

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI design & endpointsbugSomething isn't workingpriority:P1High. Should be done this cycle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions