'HTTP full-duplex channel timeout' when using the Jenkins CLI

Article ID:360040999411
1 minute readKnowledge base

Issue

  • When using the Jenkins CLI, it reports an exception like the following:

java.io.IOException: HTTP full-duplex channel timeout: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
    at jenkins.util.FullDuplexHttpService.download(FullDuplexHttpService.java:104)
    at jenkins.util.FullDuplexHttpService$Response.generateResponse(FullDuplexHttpService.java:171)
    [...]

Explanation

This error is in most cases caused by a Reverse Proxy that is buffering HTTP requests and it impacts only the CLI Protocols that relies on HTTP Full Duplex: either the deprecated -remoting mode or the -http mode of the Jenkins CLI.

As mentioned in this comment from JENKINS-43666: Since the HTTP Duplex transport requires connections to be long-lasting and unbuffered, any reverse proxy must be configured to act transparently in these regards.

Resolution

The solution is to configure the Reverse Proxy that is front of Jenkins to not buffer the request. Here are some examples:

  • For Nginx, use proxy_request_buffering off

  • For HA Proxy, use no option http-buffer-request

When running Jenkins in Kubernetes and using the Nginx Ingress Controller, add the annotations nginx.ingress.kubernetes.io/proxy-request-buffering: "off" to the Ingress resource of you controller. In CloudBees Core on Modern Platform, this annotation is set by default for operations center and managed controller ingresses.