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

Connexion to secure Docker API KO with version 5.2.2-1.0+ #30

Closed
pguinet opened this issue Nov 28, 2023 · 4 comments
Closed

Connexion to secure Docker API KO with version 5.2.2-1.0+ #30

pguinet opened this issue Nov 28, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@pguinet
Copy link

pguinet commented Nov 28, 2023

Jenkins and plugins versions report

Environment
Jenkins: 2.426.1
OS: Linux - 5.10.0-26-amd64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
[redacted]
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
apache-httpcomponents-client-5-api:5.2.1-1.1
[redacted]
docker-commons:439.va_3cb_0a_6a_fb_29
docker-java-api:3.3.4-86.v39b_a_5ede342c
docker-plugin:1.5
docker-workflow:572.v950f58993843
[redacted]

What Operating System are you using (both controller, and any agents involved in the problem)?

Debian 11
Jenkins: 2.426.1
OS: Linux - 5.10.0-26-amd64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
Docker version 24.0.7, build afdd53b

Reproduction steps

Jenkins LTS docker container (2.426.1), (configuration as code).
docker-plugin and docker-workflow latest versions.
apache-httpcomponents-client-5-api will be installed as dependency.
Configure a docker cloud with secure API (port 2376, self signed certificates) tcp://hostname:2376 and credential as x509 certificate.

Expected Results

Test connection should return docker version, such as Version = 24.0.7, API Version = 1.43
This is the result obtained with apache-httpcomponents-client-5-api:5.2.1-1.1

Actual Results

with apache-httpcomponents-client-5-api:5.2.2-1.0+ result is
jenkins | 2023-11-28 20:37:15.016+0000 [id=107] WARNING c.n.j.p.d.DockerContainerWatchdog#retrieveContainers: Unable to retrieve list of containers available on DockerCloud [name=docker on [REDACTED CLOUD NAME], dockerURI=tcp://[redacted hostname]:2376] while reading list of containers (showAll=true, labelFilters={com.nirima.jenkins.plugins.docker.JenkinsId=5297234496d116d39f2ec5c643870a08})
jenkins | java.lang.IllegalArgumentException: Invalid Proxy
jenkins | at java.base/java.net.Socket.(Socket.java:177)
jenkins | at org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.createSocket(SSLConnectionSocketFactory.java:208)
jenkins | at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)
jenkins | at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:447)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:162)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:172)
jenkins | at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:142)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:192)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:96)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:152)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:115)
jenkins | at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
jenkins | at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
jenkins | at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87)
jenkins | at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:191)
jenkins | at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202)
jenkins | at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:74)
jenkins | at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:44)
jenkins | at com.github.dockerjava.core.exec.ListContainersCmdExec.execute(ListContainersCmdExec.java:15)
jenkins | at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
jenkins | at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.retrieveContainers(DockerContainerWatchdog.java:280)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.processCloud(DockerContainerWatchdog.java:219)
jenkins | at com.nirima.jenkins.plugins.docker.DockerContainerWatchdog.execute(DockerContainerWatchdog.java:152)
jenkins | at hudson.model.AsyncPeriodicWork.lambda$doRun$0(AsyncPeriodicWork.java:102)
jenkins | at java.base/java.lang.Thread.run(Thread.java:840)

Anything else?

No response

Are you interested in contributing a fix?

No response

@pguinet pguinet added the bug Something isn't working label Nov 28, 2023
@strangelookingnerd
Copy link
Contributor

Duplicates #29

A similar issue was also reported in jenkinsci/docker-plugin#1032 and is likely caused by apache/httpcomponents-client#512
I‘d recommend to downgrade to the previous version while we wait for a fix in the HttpClient to be released.

@tmortagne
Copy link

tmortagne commented Nov 29, 2023

I‘d recommend to downgrade to the previous version while we wait for a fix in the HttpClient to be released.

Seems 5.2.3 is out with a fix for https://issues.apache.org/jira/browse/HTTPCLIENT-2292

Edit: actually I was a bit too fast here, it does not seem to be released yet, sorry (mixed with httpcore).

@strangelookingnerd
Copy link
Contributor

I just released 5.2.3-1.0 of the plugin which includes the latest http client dependency version with the fix.

@pguinet
Copy link
Author

pguinet commented Dec 4, 2023

Thanks @strangelookingnerd. I can confirm that everything is working as expected with version 5.2.3-1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants