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

Zuul returns "400 Bad Request" randomly for chunked responses #261

Closed
fiunchinho opened this issue Aug 16, 2016 · 7 comments
Closed

Zuul returns "400 Bad Request" randomly for chunked responses #261

fiunchinho opened this issue Aug 16, 2016 · 7 comments
Labels

Comments

@fiunchinho
Copy link

Hey!
Sending a PUT request to an API through Zuul returns 400 Bad Request randomly. If I send the same request directly to the API behind, it always works returning 200 OK, but if the request goes through Zuul, it sometimes returns 200 OK, sometimes fails.

Analyzing packages with tcpdump shows an strange behaviour of one http request receiving two http responses, which it shouldn't happen at all.

The API behind zuul is an Spring Boot application returning a Single object, and it sends chunks responses to Zuul. I've reproduced the same issue with this endpoint.

inputStream is reading a JSON file from the server to simulate the response. With this code, we get a 400 Bad Request one on every 10-15 requests.
It also looks like if the inputStream reads a small file, no error is shown, but if the file goes above some bytes, it starts happening.

Any help?

@mikeycohen
Copy link
Contributor

What is the origin routing code you are using? This seems like it may be a spring boot issue. Is there a stack trace or anything when this happens?

@dgomezs
Copy link

dgomezs commented Oct 23, 2016

I was experiencing this problem today and it seems gone if you upgrade to the lastests version of spring boot and zuul

@sokie
Copy link

sokie commented Jan 25, 2017

@dgomezs what version of both seems to be fixing this issue?

@dgomezs
Copy link

dgomezs commented Jan 25, 2017

hey @sokie

This is the config I have and that has been working for me.

def springBootRelease = "1.4.1.RELEASE"

dependencyManagement {
    imports {
        mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Camden.SR1'
    }
}

dependencies {

    // tag::jetty[]
    compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootRelease) {
        exclude module: "spring-boot-starter-tomcat"
    }

    compile group: 'org.springframework.boot', name: 'spring-boot-starter-jetty', version: springBootRelease

    // end::jetty[]

    // tag::actuator[]
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootRelease
    // end::actuator[]

    compile 'org.springframework.cloud:spring-cloud-security:1.1.3.RELEASE'

    compile 'org.springframework.cloud:spring-cloud-starter-zuul:1.2.1.RELEASE'
    compile 'org.springframework.cloud:spring-cloud-starter-security:1.1.3.RELEASE'
    compile 'org.springframework.security.oauth:spring-security-oauth2:2.0.11.RELEASE'
    compile "org.springframework.security:spring-security-jwt:1.0.5.RELEASE"

}

I hope it helps

@18099538715
Copy link

I met this because I have wrote my own filter, In my filter I change the body size ,then the real content-length is not equals to the value in head.

Copy link

github-actions bot commented Dec 6, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 6, 2024
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants