apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: 499 error code!!!help!!!

Open zhoudingyu123 opened this issue 4 years ago • 15 comments

Description

I need to request a time-consuming operation through apisix, which will take more than 60 seconds.Both postman and curl return errors, unless you don't use apisix. I tried almost all the settings about keepalive, but it didn't work. 400 error code returned when modifying 'proxy_ignore_client_abort on'.

Environment

  • APISIX version (run apisix version):
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

zhoudingyu123 avatar May 25 '22 03:05 zhoudingyu123

Are there any steps to reproduce? With only these simple descriptions, no one can know what happened

moonming avatar May 25 '22 03:05 moonming

For example: Send a simple post request through curl, The response of the server, xxx std::this_thread::sleep_for(std::chrono::seconds(100)); xxx

It happened!

zhoudingyu123 avatar May 25 '22 06:05 zhoudingyu123

Are there any steps to reproduce? With only these simple descriptions, no one can know what happened

For example: Send a simple post request through curl, The response of the server, xxx std::this_thread::sleep_for(std::chrono::seconds(100)); xxx

It happened!

zhoudingyu123 avatar May 25 '22 06:05 zhoudingyu123

see: https://github.com/apache/apisix/issues/4715

tzssangglass avatar May 25 '22 06:05 tzssangglass

see: #4715

I've tried. It doesn't work.

zhoudingyu123 avatar May 25 '22 06:05 zhoudingyu123

see: #4715

I've tried. It doesn't work.

Go to 400 error.

zhoudingyu123 avatar May 25 '22 06:05 zhoudingyu123

In any case, the information you gave is not enough for me to reproduce the error you encountered.

I need

  • APISIX configuration, including config.yaml, route, upstream configuration
  • What is the upstream service and how should I simulate your upstream behavior?
  • How to test?

For all of the above information, text is required rather than screenshots.

If you don't know how to prepare this information, you can refer to these issues for how to provide effective information.

https://github.com/apache/apisix/issues/6834 https://github.com/apache/apisix/issues/6169

tzssangglass avatar May 25 '22 06:05 tzssangglass

In any case, the information you gave is not enough for me to reproduce the error you encountered.

I need

  • APISIX configuration, including config.yaml, route, upstream configuration
  • What is the upstream service and how should I simulate your upstream behavior?
  • How to test?

For all of the above information, text is required rather than screenshots.

If you don't know how to prepare this information, you can refer to these issues for how to provide effective information.

#6834 #6169 测试相关.docx

thanks

zhoudingyu123 avatar May 25 '22 07:05 zhoudingyu123

499返回码一般是客户端主动超时产生的错误呀,是不是客户端默认加了60S的timeout? 你试试将curl命令加一个自定义超时参数:

--connect-timeout 20 --max-time 300

所以你现在的问题是APISIX超时无法突破60s么? 看你测试文档里面,APISIX用的默认配置,那默认就是60S超时了吧。 一般要在上游配置中加上:

"timeout": {
    "connect": 6,
    "send": 300,
    "read": 300
  },

来调整超时设置。

jagerzhang avatar Jun 16 '22 09:06 jagerzhang

这些我都尝试了都不行,对于我来讲,如果让我解决这个问题,我只能去看源码的流程,看是否哪里写死了60s;不过我对lua语言不熟,所以没有这么做。 另外,对于上游服务来讲,apisix是客户端的角色;这个问题是apisix到上游的问题不是前台到apisix的问题 您提供的两种方式都是前台到apisxi之间的问题

zhoudingyu123 avatar Jun 16 '22 09:06 zhoudingyu123

这些我都尝试了都不行,对于我来讲,如果让我解决这个问题,我只能去看源码的流程,看是否哪里写死了60s;不过我对lua语言不熟,所以没有这么做。 另外,对于上游服务来讲,apisix是客户端的角色;这个问题是apisix到上游的问题不是前台到apisix的问题 您提供的两种方式都是前台到apisxi之间的问题

是不是这样: 访问路径:客户端 --> APISIX --> 上游应用 现在的问题是上游应用日志里打印了499返回码,说明是APISIX访问上游应用的时候主动超时了,对吧?

那APISIX的日志显示的返回码是多少呢?

还有个笨办法,你弄个nginx代理,代理到上游试试呢?

jagerzhang avatar Jun 16 '22 10:06 jagerzhang

我最近直接请求apisix的管理端api(如域名/apisix/admin/routes)这种接口,也偶尔报499,好奇怪

StretchV avatar Nov 28 '22 10:11 StretchV

@StretchV Could you check out if the communication between APISIX and ETCD is slow? 499 means the client closes the connection before server-side returning any byte.

tokers avatar Nov 28 '22 11:11 tokers

Problem solved,It turns out that the upstream of this route is unstable

StretchV avatar Nov 29 '22 09:11 StretchV

Problem solved,it is version problem,change newlest version,it's ok!

zhoudingyu123 avatar Nov 29 '22 10:11 zhoudingyu123