testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.05k stars 1.66k forks source link

[Bug]: Doesn't work behind proxy since 1.20.0 (1.20.1 too) #9141

Open Piscenois opened 3 months ago

Piscenois commented 3 months ago

Module

Core

Testcontainers version

1.20.0

Using the latest Testcontainers version?

Yes

Host OS

Linux OL8

Host Arch

x86

Docker version

20.10.21

What happened?

When we upgrade the testcontainers version from 1.19.8 to 1.20.* our container (oracle free database) doesn't start anymore.

We usually use the docker image from Oracle container registry like this :

    private static final DockerImageName oracleFreeImage = DockerImageName
            .parse("container-registry.oracle.com/database/free:23.3.0.0")
            .asCompatibleSubstituteFor("gvenzl/oracle-free");

We tried without success to use the one from testcontainers :

    public static OracleContainer oracleContainer = new OracleContainer("gvenzl/oracle-free:23.4-slim-faststart")

The behaviour is always the same in Jenkins (maven 3.6.2) :

[ERROR]   MyTestClass.theTest » NoClassDefFound

It works perfectly on local machine (Windows 10, maven 3.6.2).

The Jenkins jobs runs on OL8 machine behind an enterprise proxy. The credentials are configured in

/etc/systemd/system/docker.service.d/http-proxy.conf

like that

[Service]
Environment="HTTP_PROXY=http://myuser:mypwd@proxy.mycompany.com:3128"
Environment="HTTPS_PROXY=http://myuser:mypwd@proxy.mycompany.com:3128"
Environment="NO_PROXY=localhost,127.0.0.0/8,mycompany.com,local"

This was working with 1.19.8 and 1.19.7.

I tried to force environment variables with .withEnv("HTTP_PROXY... It had no effect.

I guess this bug comes from a dependency but I didn't manage to find which incriminate.

I can help to run any workaround if you need me.

Regards

Relevant log output

unfortunately nothing

Additional Information

No response

eddumelendez commented 3 months ago

I don't have any change that could affect that on top of my mind. But, can you make sure all your Testcontainers dependencies are using the same version. Use mvn dependency:tree to confirm

Piscenois commented 3 months ago

I don't have any change that could affect that on top of my mind. But, can you make sure all your Testcontainers dependencies are using the same version. Use mvn dependency:tree to confirm

[INFO] com.mycompany.myapp:myapp:jar:xx.yy.zz
[INFO] +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] +- org.jodd:jodd-core:jar:5.1.3:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-openfeign:jar:3.0.8:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:3.0.6:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:3.0.6:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.11.RELEASE:compile
[INFO] |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.69:compile
[INFO] |  |        +- org.bouncycastle:bcprov-jdk15on:jar:1.69:compile
[INFO] |  |        \- org.bouncycastle:bcutil-jdk15on:jar:1.69:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-openfeign-core:jar:3.0.8:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.5.15:compile
[INFO] |  |  \- io.github.openfeign.form:feign-form-spring:jar:3.8.0:compile
[INFO] |  |     \- io.github.openfeign.form:feign-form:jar:3.8.0:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.27:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-commons:jar:3.0.6:compile
[INFO] |  |  \- org.springframework.security:spring-security-crypto:jar:5.5.8:compile
[INFO] |  +- io.github.openfeign:feign-core:jar:10.12:compile
[INFO] |  \- io.github.openfeign:feign-slf4j:jar:10.12:compile
[INFO] +- io.swagger.core.v3:swagger-annotations:jar:2.2.16:compile
[INFO] +- org.openapitools:jackson-databind-nullable:jar:0.2.6:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.12.7.1:compile
[INFO] +- org.json:json:jar:20231013:compile
[INFO] +- com.opencsv:opencsv:jar:5.8:compile
[INFO] |  +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  \- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] +- net.lingala.zip4j:zip4j:jar:2.11.5:compile
[INFO] +- org.testcontainers:oracle-free:jar:1.20.1:test
[INFO] |  \- org.testcontainers:jdbc:jar:1.20.1:test
[INFO] |     \- org.testcontainers:database-commons:jar:1.20.1:test
[INFO] |        \- org.testcontainers:testcontainers:jar:1.20.1:test
[INFO] |           +- org.apache.commons:commons-compress:jar:1.24.0:test
[INFO] |           +- org.rnorth.duct-tape:duct-tape:jar:1.0.8:test
[INFO] |           |  \- org.jetbrains:annotations:jar:17.0.0:test
[INFO] |           +- com.github.docker-java:docker-java-api:jar:3.4.0:test
[INFO] |           \- com.github.docker-java:docker-java-transport-zerodep:jar:3.4.0:test
[INFO] |              +- com.github.docker-java:docker-java-transport:jar:3.4.0:test
[INFO] |              \- net.java.dev.jna:jna:jar:5.13.0:test
[INFO] +- org.springframework.boot:spring-boot-starter-batch:jar:2.5.15:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.5.15:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.5.15:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.5.15:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.12:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.12:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.28:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-jdbc:jar:2.5.15:compile
[INFO] |     \- com.zaxxer:HikariCP:jar:4.0.3:compile
[INFO] +- org.springframework.batch:spring-batch-core:jar:4.3.10:compile
[INFO] |  +- io.micrometer:micrometer-core:jar:1.7.12:compile
[INFO] |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] |  +- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] |  +- org.springframework.batch:spring-batch-infrastructure:jar:4.3.10:compile
[INFO] |  |  \- org.springframework.retry:spring-retry:jar:1.3.4:compile
[INFO] |  +- org.springframework:spring-aop:jar:5.3.27:compile
[INFO] |  +- org.springframework:spring-beans:jar:5.3.27:compile
[INFO] |  +- org.springframework:spring-context:jar:5.3.27:compile
[INFO] |  |  \- org.springframework:spring-expression:jar:5.3.27:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.27:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.27:compile
[INFO] |  \- org.springframework:spring-tx:jar:5.3.27:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.5.15:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.5.15:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.7:compile
[INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.4.33:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.4.3.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.27.0-GA:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.22:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.2.3.Final:compile
[INFO] |  |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  |  +- org.dom4j:dom4j:jar:2.1.3:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.2.Final:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.8:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.8:compile
[INFO] |  |     \- com.sun.istack:istack-commons-runtime:jar:3.0.12:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.5.12:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.5.12:compile
[INFO] |  |  \- org.springframework:spring-orm:jar:5.3.27:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.3.27:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jdbc:jar:2.5.15:compile
[INFO] |  \- org.springframework.data:spring-data-jdbc:jar:2.2.12:compile
[INFO] |     \- org.springframework.data:spring-data-relational:jar:2.2.12:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.5.15:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.5.15:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.12.7:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.12.7:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.5.15:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.75:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.75:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.75:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.27:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-ldap:jar:2.5.15:compile
[INFO] |  \- org.springframework.data:spring-data-ldap:jar:2.5.12:compile
[INFO] |     \- org.springframework.ldap:spring-ldap-core:jar:2.3.8.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:2.5.15:compile (optional)
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:2.5.15:compile
[INFO] |  +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.5.3:compile
[INFO] |  |  +- jakarta.xml.soap:jakarta.xml.soap-api:jar:1.4.2:compile
[INFO] |  |  +- org.jvnet.staxex:stax-ex:jar:1.8.3:compile
[INFO] |  |  \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] |  +- jakarta.xml.ws:jakarta.xml.ws-api:jar:2.3.3:compile
[INFO] |  |  \- jakarta.jws:jakarta.jws-api:jar:2.1.0:runtime
[INFO] |  +- org.springframework:spring-oxm:jar:5.3.27:compile
[INFO] |  \- org.springframework.ws:spring-ws-core:jar:3.1.6:compile
[INFO] |     \- org.springframework.ws:spring-xml:jar:3.1.6:compile
[INFO] +- org.springframework.integration:spring-integration-sftp:jar:5.5.18:compile
[INFO] |  +- org.springframework.integration:spring-integration-file:jar:5.5.18:compile
[INFO] |  |  \- org.springframework.integration:spring-integration-core:jar:5.5.18:compile
[INFO] |  |     +- org.springframework:spring-messaging:jar:5.3.27:compile
[INFO] |  |     \- io.projectreactor:reactor-core:jar:3.4.29:compile
[INFO] |  |        \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] |  +- com.jcraft:jsch:jar:0.1.55:compile
[INFO] |  \- org.springframework:spring-context-support:jar:5.3.27:compile
[INFO] +- org.springframework.integration:spring-integration-ftp:jar:5.5.18:compile
[INFO] |  \- commons-net:commons-net:jar:3.8.0:compile
[INFO] +- org.liquibase:liquibase-maven-plugin:jar:4.27.0:compile
[INFO] |  \- org.liquibase:liquibase-commercial:jar:4.27.0:runtime
[INFO] +- org.liquibase:liquibase-core:jar:4.27.0:compile
[INFO] |  \- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] +- com.oracle.database.jdbc:ojdbc8:jar:19.22.0.0:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.12.7:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.7:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-core:jar:2.12.7:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.26:compile
[INFO] +- org.springdoc:springdoc-openapi-ui:jar:1.6.2:compile
[INFO] |  +- org.springdoc:springdoc-openapi-webmvc-core:jar:1.6.2:compile
[INFO] |  |  \- org.springdoc:springdoc-openapi-common:jar:1.6.2:compile
[INFO] |  |     +- io.swagger.core.v3:swagger-models:jar:2.1.11:compile
[INFO] |  |     +- io.swagger.core.v3:swagger-integration:jar:2.1.11:compile
[INFO] |  |     |  \- io.swagger.core.v3:swagger-core:jar:2.1.11:compile
[INFO] |  |     |     +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.12.7:compile
[INFO] |  |     |     \- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |  |     \- io.github.classgraph:classgraph:jar:4.8.116:compile
[INFO] |  +- org.webjars:swagger-ui:jar:4.1.3:compile
[INFO] |  \- org.webjars:webjars-locator-core:jar:0.46:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.5.15:compile
[INFO] |  \- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.5.15:compile
[INFO] |     \- org.springframework.boot:spring-boot-actuator:jar:2.5.15:compile
[INFO] +- io.github.mweirauch:micrometer-jvm-extras:jar:0.2.2:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] +- io.micrometer:micrometer-registry-prometheus:jar:1.7.12:runtime
[INFO] |  \- io.prometheus:simpleclient_common:jar:0.10.0:runtime
[INFO] |     \- io.prometheus:simpleclient:jar:0.10.0:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.5.15:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.5.15:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.5.15:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.5.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.4.10:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:2.4.9:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] |  +- org.assertj:assertj-core:jar:3.19.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.7.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.7.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.7.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.7.2:test
[INFO] |  +- org.mockito:mockito-core:jar:3.9.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.22:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.9.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.27:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.8.4:test
[INFO] +- org.springframework.batch:spring-batch-test:jar:4.3.10:test
[INFO] |  +- junit:junit:jar:4.13.2:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] |  \- org.springframework:spring-jdbc:jar:5.3.27:compile
[INFO] +- org.junit.vintage:junit-vintage-engine:jar:5.7.2:test
[INFO] |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  \- org.junit.platform:junit-platform-engine:jar:1.7.2:test
[INFO] |     +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |     \- org.junit.platform:junit-platform-commons:jar:1.7.2:test
[INFO] +- com.h2database:h2:jar:2.2.224:test
[INFO] +- p6spy:p6spy:jar:3.9.1:test
[INFO] +- com.github.tomakehurst:wiremock-jre8:jar:2.35.1:test
[INFO] |  +- org.eclipse.jetty:jetty-server:jar:9.4.51.v20230217:test
[INFO] |  |  +- javax.servlet:javax.servlet-api:jar:4.0.1:test
[INFO] |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.51.v20230217:test
[INFO] |  |  +- org.eclipse.jetty:jetty-security:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-servlets:jar:9.4.51.v20230217:test
[INFO] |  |  +- org.eclipse.jetty:jetty-continuation:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-webapp:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-xml:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-proxy:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-client:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty.http2:http2-server:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty.http2:http2-common:jar:9.4.51.v20230217:test
[INFO] |  |     \- org.eclipse.jetty.http2:http2-hpack:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-server:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-java-server:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-openjdk8-server:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-java-client:jar:9.4.51.v20230217:test
[INFO] |  |  \- org.eclipse.jetty:jetty-alpn-client:jar:9.4.51.v20230217:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-openjdk8-client:jar:9.4.51.v20230217:test
[INFO] |  +- com.google.guava:guava:jar:31.1-jre:test
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:test
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:test
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:test
[INFO] |  |  +- org.checkerframework:checker-qual:jar:3.12.0:test
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.11.0:test
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:test
[INFO] |  +- org.apache.httpcomponents.client5:httpclient5:jar:5.0.4:test
[INFO] |  |  +- org.apache.httpcomponents.core5:httpcore5:jar:5.1.5:test
[INFO] |  |  +- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.1.5:test
[INFO] |  |  \- commons-codec:commons-codec:jar:1.15:test
[INFO] |  +- org.xmlunit:xmlunit-legacy:jar:2.8.4:test
[INFO] |  +- org.xmlunit:xmlunit-placeholders:jar:2.8.4:test
[INFO] |  +- net.javacrumbs.json-unit:json-unit-core:jar:2.36.0:test
[INFO] |  +- org.ow2.asm:asm:jar:9.4:test
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
[INFO] |  +- com.github.jknack:handlebars:jar:4.3.1:test
[INFO] |  +- com.github.jknack:handlebars-helpers:jar:4.3.1:test
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.4:compile
[INFO] |  \- commons-io:commons-io:jar:2.11.0:compile
[INFO] +- info.cukes:cucumber-java:jar:1.2.5:test
[INFO] |  \- info.cukes:cucumber-core:jar:1.2.5:test
[INFO] |     +- info.cukes:cucumber-html:jar:0.2.3:test
[INFO] |     +- info.cukes:cucumber-jvm-deps:jar:1.0.5:test
[INFO] |     \- info.cukes:gherkin:jar:2.12.2:test
[INFO] +- info.cukes:cucumber-junit:jar:1.2.5:test
[INFO] \- info.cukes:cucumber-spring:jar:1.2.5:test

Hope it helps 🤞