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

Newer httpclient 5 API breaks tests of the docker plugin #1103

Open
MarkEWaite opened this issue Oct 1, 2024 · 7 comments
Open

Newer httpclient 5 API breaks tests of the docker plugin #1103

MarkEWaite opened this issue Oct 1, 2024 · 7 comments
Assignees
Labels
bug An issue reporting a bug or a PR fixing one.

Comments

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Oct 1, 2024

Jenkins and plugins versions report

Environment summary

  • Fails tests: Ubuntu 22.04 virtual machine agent on ci.jenkins.io with Docker installed and authorized, but with no Docker daemon available on port 2375
  • Fails tests: Debian testing with Docker installed and authorized for my user account, but with no Docker daemon available on port 2375
  • Passes tests: Ubuntu 22.04 with Docker installed and authorized for my user account and with a Docker daemon available on port 2375

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

Ubuntu 22.04 and Debian without Docker listening on port 2375 fails tests when testing with apache-httpcomponents-client-5-api 5.4-118.v199115451c4d . The same tests pass if tested with apache-httpcomponents-client-5-api 5.3.1-110.v77252fb_d4da_5

Ubuntu 22.04 and Debian with Docker listening on port 2375 passes tests with both versions of apache-httpcomponents-client-5-api

Reproduction steps

  1. Run tests on ci.jenkins.io or on a local computer that does not have a Docker listener on port 2375, confirm tests fail unless the apache-httpcomponents-client-5-api library used in the test is forced to 5.3.1-110.v77252fb_d4da_5

Expected Results

Tests should pass with both the older and the newer version of the apache-httpcomponents-client-5-api library

Actual Results

Test fail unexpectedly unless a Docker listener is available on port 2375

Anything else?

Failure seems to be specific to the tests. Assumed that there is some difference in exception handling between the two versions of the apache-httpcomponents-client-5-api library.

Are you interested in contributing a fix?

Yes, though not sure when time will allow it. A temporary workaround has been applied in:

@MarkEWaite MarkEWaite added the bug An issue reporting a bug or a PR fixing one. label Oct 1, 2024
MarkEWaite added a commit that referenced this issue Oct 1, 2024
#1103 describes the
issue.

Ubuntu 22.04 and Debian without Docker listening on port 2375 fails
tests when testing with apache-httpcomponents-client-5-api
5.4-118.v199115451c4d . The same tests pass if tested with
apache-httpcomponents-client-5-api 5.3.1-110.v77252fb_d4da_5

Ubuntu 22.04 and Debian with Docker listening on port 2375 passes
tests with both versions of apache-httpcomponents-client-5-api
@MarkEWaite MarkEWaite self-assigned this Oct 1, 2024
@MarkEWaite
Copy link
Contributor Author

@krisstern I'm truly surprised by this failure, but did not want to block the update to the most recent plugin bill of materials. I've assigned it to myself, but I'm not yet sure when I will have time to investigate it.

@kirk-fitzsimons
Copy link

I am getting failing tests locally on latest

[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 9.096 s <<< FAILURE! -- in io.jenkins.docker.client.ConfigurationAsCodeTest [ERROR] io.jenkins.docker.client.ConfigurationAsCodeTest.should_support_old_configuration -- Time elapsed: 7.548 s <<< FAILURE! java.lang.AssertionError: Unexpected exception at io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule.before(JenkinsConfiguredWithCodeRule.java:50) at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:649) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: io.jenkins.plugins.casc.UnknownAttributesException: cloud: No hudson.slaves.Cloud implementation found for docker at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$lookupDescriptor$12(HeteroDescribableConfigurator.java:236) at io.vavr.control.Option.orElse(Option.java:321) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lookupDescriptor(HeteroDescribableConfigurator.java:227) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86) at io.vavr.Tuple2.apply(Tuple2.java:238) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:86) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:94) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:57) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:355) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:293) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$9(ConfigurationAsCode.java:834) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:834) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:820) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:699) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:668) at io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule.before(JenkinsConfiguredWithCodeRule.java:47) ... 3 more

Env:
Windows 10
OpenJDK Runtime Environment Temurin-17.0.12+7

@MarkEWaite
Copy link
Contributor Author

I am getting failing tests locally on latest

Env:
Windows 10
OpenJDK Runtime Environment Temurin-17.0.12+7

Any guess about what is different between your Windows computer and the Windows agent on ci.jenkins.io where the tests pass?

@kirk-fitzsimons
Copy link

I am getting failing tests locally on latest
Env:
Windows 10
OpenJDK Runtime Environment Temurin-17.0.12+7

Any guess about what is different between your Windows computer and the Windows agent on ci.jenkins.io where the tests pass?

Not sure:

PS C:\Users\fitzsimok\dev\docker-plugin> mvn clean verify -X
Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
Maven home: C:\apache-maven-3.9.8
Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

@kirk-fitz
Copy link

Hit the same error in wsl(ubuntu) on the same host

Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)
Maven home: /mnt/c/apache-maven-3.9.8
Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-17-jdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.153.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"

@kirk-fitz
Copy link

I thought it might be an issue with my env on company laptop, but I ran on my personal laptop, with same version of java and maven,

PS C:\Users\Kirk\git\docker-plugin> mvn install -X Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256) Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.8 Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot Default locale: en_IE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

and have reproduced the issue with the tests, also when i run mvn hpi:run docker does not show up as a cloud even though the plugin is installed...

Image

Image

@MarkEWaite
Copy link
Contributor Author

I thought it might be an issue with my env on company laptop, but I ran on my personal laptop, with same version of java and maven,

I'm not sure that anyone has attempted to use the docker plugin as a cloud provider on a Windows installation of Docker. I use it with a Linux host that runs Docker. The Windows agents on ci.jenkins.io may not have Docker installed or they may have Docker installed and configured in such a way that the tests in the plugin are skipped. Your Docker configuration on Windows may be different enough from the ci.jenkins.io agents that the tests are not skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue reporting a bug or a PR fixing one.
Projects
None yet
Development

No branches or pull requests

3 participants