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

help request: 499 error code!!!help!!! #7121

Closed
zhoudingyu123 opened this issue May 25, 2022 · 15 comments
Closed

help request: 499 error code!!!help!!! #7121

zhoudingyu123 opened this issue May 25, 2022 · 15 comments

Comments

@zhoudingyu123
Copy link

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):
@moonming
Copy link
Member

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

@zhoudingyu123
Copy link
Author

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
Copy link
Author

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!

@tzssangglass
Copy link
Member

see: #4715

@zhoudingyu123
Copy link
Author

see: #4715

I've tried. It doesn't work.

@zhoudingyu123
Copy link
Author

see: #4715

I've tried. It doesn't work.

Go to 400 error.

@tzssangglass
Copy link
Member

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

@zhoudingyu123
Copy link
Author

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

@jagerzhang
Copy link
Contributor

jagerzhang commented Jun 16, 2022

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

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

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

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

来调整超时设置。

@zhoudingyu123
Copy link
Author

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

@jagerzhang
Copy link
Contributor

jagerzhang commented Jun 16, 2022

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

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

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

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

@StretchV
Copy link

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

@tokers
Copy link
Contributor

tokers commented Nov 28, 2022

@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.

@StretchV
Copy link

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

@zhoudingyu123
Copy link
Author

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

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

6 participants