nacos
nacos copied to clipboard
nacos client bad request 400
Describe the bug A clear and concise description of what the bug is. maven install 导出项目的jar包,本地开发运行,在部分机器上正常运行,在部分机器上启动报错 bad request
Maven install exports the jar package of the project, develops and runs locally, runs normally on some machines, and starts bad request on some machines
Desktop (please complete the following information):
- OS: windows10
- Version [nacos-server 2.0.1, nacos-client 1.4.2]
- Module [naming and config]
- SDK [jdk1.8, spring-cloud-alibaba-nacos, spring cloud]
Additional context
Add any other context about the problem here.
the exception :
Caused by: com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance after all servers([http://nacos-test.xxxxx.cn:80]) tried: ErrCode:400, ErrMsg:<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Mon Aug 30 17:41:11 CST 2021</div><div>There was an unexpected error (type=Bad Request, status=400).</div><div>receive invalid redirect request from peer 10.233.71.38</div></body></html>
你的集群搭建的有问题,导致请求路由异常了。
你看一下发送的请求头,我之前遇到过类似的问题,因为经过两个网关,X-forwarded-host的值重复了,就报了400错误。
你的集群搭建的有问题,导致请求路由异常了。
具体哪些问题导致的?线上的集群基本没出现过,测试环境经常这样。 是集群之间连接访问的问题吗 @KomachiSion
你看一下发送的请求头,我之前遇到过类似的问题,因为经过两个网关,X-forwarded-host的值重复了,就报了400错误。
哪个请求头,客户端的请求头吗,直接用postman请求的,我修改了客户端的ip是没问题的,有些客户端ip不行。网关X-forwarded-host重复,是指网关配置问题?具体怎样解决的
看一下集群的cluster.conf 是不是有多出来的ip之类的, 很可能是集群搭建的时候配置不正确,或者存在多网卡,域名等情况,导致节点自身地址和配置地址不一致导致的。
同时如果有网络代理或网关转发等,都有可能导致服务端判断请求来源时出错,建议配置代理或转发时不进行任何修改。
我的也是这个问题 把nginx去掉也不行 cluster.config就三个ip,后台管理里显示三个节点也没问题,但还是老400
Thanks for your feedback and contribution. But the issue/pull request has not had recent activity more than 180 days. This issue/pull request will be closed if no further activity occurs 7 days later. We may solve this issue in new version. So can you upgrade to newest version and retry? If there are still issues or want to contribute again. Please create new issue or pull request again.