-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
StripPrefixGatewayFilter 404 #3215
Comments
where is the 404? |
saas-order-platform, /api/order/platform/**, StripPrefix=3, Under normal circumstances, when calling the URL http://gateway/api/order/thirdplatform/a/b, the request is directed to the path /a/b of the saas-order-platform service. However, in some situations, the StripPrefix value has inexplicably changed to 2. In this case, when calling the URL http://gateway/api/order/thirdplatform/a/b, the request is directed to the path /thirdplatform/a/b of the saas-order-platform service, resulting in a 404 error. |
Is there an official solution to this problem? We also encountered it. In cases of high concurrency, there may be routing path errors and StripPrefix={2} not taking effect. |
In the future, please refrain from sharing text via images. If you'd like us to spend some time investigating, please take the time to provide a complete, minimal, verifiable sample (something that we can unzip attached to this issue or git clone, build, and deploy) that reproduces the problem. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Manifest-Version: 1.0
Implementation-Title: Spring Cloud Gateway Core
Implementation-Version: 2.1.3.RELEASE
Built-By: jenkins
Implementation-Vendor-Id: org.springframework.cloud
Created-By: Apache Maven 3.5.0
Build-Jdk: 1.8.0_201
Implementation-URL: https://spring.io/spring-cloud/spring-cloud-gateway/spring-cloud-gateway-core
Implementation-Vendor: Pivotal Software, Inc.
I am currently encountering a 404 issue, and I haven't found any relevant information in the issues or on Stack Overflow. I would like to know if this problem has been fixed in the latest version. If it has been fixed, please provide the resolution method. Thank you very much. (Due to the involvement of too many services, upgrading the gateway version is currently not possible.)
To troubleshoot the issue, I added some logs in the source code. Below is the source code with the added logs.
The 2nd, 4th, and 6th lines in the log are all related to the route "saas-mini-application." From the log, it can be observed that in the 2nd line, the
args
are {parts=2}, but in the 4th line, theconfiguration
is 3. However, from the code, it can be seen that the value ofconfiguration
comes from theargs
. This bug is not consistently reproducible and occurs with a very low probability. Therefore, I suspect it might be a concurrency issue. From the log, it can be seen that at this moment, there is another log entry for a different route, "saas-order-third-platform," and for this route, parts=3.The text was updated successfully, but these errors were encountered: