上线与运维
常见问题
调试 Base、client、token 和 env 的常见路径。
client 返回 401
检查:
- 请求是否带了
Authorization: Bearer <user_token>。 - token 是否过期。
- Base 是否配置了
VISIBLEBASE_TOKEN_SIGNING_KEY。 - token 是否由当前 Base 签发。
product_id是否和 token 里的 product 一致。
client 返回 403
检查:
- 请求体里的
product_id是否和当前user_token所属 product 一致。 - token 所属 product 是否已经被暂停。
- 管理端签发 token 时,目标 product 是否是
active。
client 返回 404
检查:
- 调用的 HTTP 路由是否正确。
- 目标 service 是否已经在 Base 里注册。
- 管理端签发 token 时,目标 product 是否存在。
模型不存在或没有命中 handler
检查:
- client 传入的
model是否存在于visiblebase_models表。 - 模型
status是否为active。 - 当前 service 是否配置了
default()。 - 当前 service 的
match()是否能命中这个模型。
这类问题通常会返回 422。
Base 返回 500
检查:
- Base 是否配置了
VISIBLEBASE_TOKEN_SIGNING_KEY和VISIBLEBASE_ADMIN_SECRET_KEY。 - 目标 service 是否已经注册 handler。
- handler 或 provider 调用是否抛出了没有
statusCode的错误。 onErrorhook 是否记录了原始错误。
provider 调用失败
检查:
- Base
.env是否存在对应 key。 - handler 是否读取了正确的
ctx.env字段。 - 模型
config_json是否和当前 provider 调用方式匹配。
usage 没有记录
检查:
afterhook 是否注册到all()或目标 service。- 记录逻辑是否依赖某个 output 字段但 handler 没有返回。
- 日志服务是否吞掉了异常。