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

StripPrefixGatewayFilter using wrong parts to rebuild path causes routing 404 #3587

Open
chengyouling opened this issue Nov 8, 2024 · 2 comments

Comments

@chengyouling
Copy link

chengyouling commented Nov 8, 2024

Exception phenomenon:
The value is expected to be StripPrefix=2 to rebuild path in the router, however, in some scenarios using StripPrefix=1.
This problem occurs occasionally in high-concurrency scenarios, and the target service address is correct by lb.

Similar issues in history
#3215

Gateway version:
2.1.3.RELEASE

Router config:

spring:
  cloud:
    gateway:
      routes:
        - id: consumer
          uri: lb://basic-consumer
          predicates:
            - Path=/api/template/**
          filters:
            - StripPrefix=2

logs

2024-11-07 12:56:45.846 ERROR [notary-cloud-gateway,bdc3393ef21cf030462f3e197c1589c2,d42baa8dcddc6db9,true] 8 --- [reactor-http-epoll-2@] c.n.g.Exception.JsonExceptionHandler     : Failed to handle request [POST http://nc-gateway.fxnotary.com/api/template/templateModel/findTemplateModelByCode]: syntax error, pos 1, line 1, column 2<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'>Thu Nov 07 12:56:44 CST 2024</div><div>There was an unexpected error (type=Not Found, status=404).</div><div>Not Found</div></body></html>

The new path after StripPrefixGatewayFilter logs, the uri address is the basic-consumer service instance exists.

2024-11-07 12:56:44.823 DEBUG [notary-cloud-gateway,,,] 8 --- [reactor-http-epoll-2@] r.netty.http.client.HttpClientConnect    : [id: 0x23b0f6fb, L:/10.10.35.51:58378 - R:10.10.11.225/10.10.11.225:8080] Handler is being applied: {uri=http://10.10.11.225:8080/template/templateModel/findTemplateModelByCode, method=POST}

Looking forward to your reply.

Thank you!

@spencergibb
Copy link
Member

Unfortunately, that version is no longer supported. Can you recreate the issue in the latest version?

@chengyouling
Copy link
Author

Thank you for your reply, how can I raise an issue in the latest version?

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

No branches or pull requests

3 participants