Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

异常正常报警, 但是没有成功入库的问题 #167

Open
lovelmh13 opened this issue Jul 28, 2021 · 0 comments
Open

异常正常报警, 但是没有成功入库的问题 #167

lovelmh13 opened this issue Jul 28, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

通过查看日志发现,抛出了 500 request entity too large 的异常。表示上传的数据过大了。

但是数据是客户端上报的,不是数据问题,只是个别报错的长度过长。

经过搜索 发现 nginx 有上传大小的限制,但是抛出的是 413。

因为是 500 所以不是 nginx 的问题。

排查 jarvis 服务本身,发现使用的 koa-body 中间件有默认的上传限制:

  • jsonLimit{String|Integer} The byte (if integer) limit of the JSON body, default 1mb
  • formLimit{String|Integer} The byte (if integer) limit of the form body, default 56kb
  • textLimit{String|Integer} The byte (if integer) limit of the text body, default 56kb
    于是更改配置,改成 5mb,request entity too large 解决。

观察后续日志,发现新错误,reason 的长度不够,于是知道刚才出现 request entity too large 的原因是因为有的异常的 reason 长度超出了限制。

更改 reason 字段为longtext,解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant