You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating testcontainers to 1.19.4 crashes multiple pipelines in different projects and on different enviroments.
Relevant log output
java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(org.apache.commons.compress.archivers.tar.TarArchiveEntry)'
at org.testcontainers.images.builder.Transferable.transferTo(Transferable.java:80)
at org.testcontainers.containers.ContainerState.copyFileToContainer(ContainerState.java:355)
at org.testcontainers.containers.KafkaContainer.containerIsStarting(KafkaContainer.java:199)
at org.testcontainers.containers.GenericContainer.containerIsStarting(GenericContainer.java:715)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:492)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:357)
In my project, commons-compress brought in via testcontainers (1.25) was conflicting with the one brought in via hadoop-commons (1.21). Making an exclusion on hadoop-commons fixes the issue.
But it kind of brings another issue ( tentative ), as excluding a transitive dependency in main to fix something for test.
We've also been affected by this in Spring Boot's build. There's an awkward combination of main and test dependency versions and dealing with deprecation warnings that I haven't managed to find a good way to address.
@eddumelendez@anoopnarang thank you for the hint. I added commons-compress:1.25.0 as an explicit dependency to my project. Now everything is fine again 👍
@wilkinsona sorry about the issue. So far, we can not shade the dependency because it is part of the public API 😢 . What I was thinking is downgrade the dependency so public void putArchiveEntry(final ArchiveEntry archiveEntry) still supports TarArchiveEntry. I've tested some examples with combination of Testcontainers 1.19.3 (with commons-compress 1.23.0) and commons-compress 1.25.0 and works. LMK if this would help.
Hey, Eddu. We did manage to work around this in the end in our build with some Gradle gymnastics. That said, a downgrade would help us and allow us to simplify the build a bit. I think it may also help Maven users where version conflicts are resolved by nearest to the root of the graph rather than the highest wins that Gradle uses. This means that Maven projects that use Commons Compress and Maven are more likely to end up with an older version of Commons Compress with which Testcontainers isn't compatible. Perhaps the upgrade to the latest version could then be done in Testcontainers 1.20?
We are going to release a new version downgrading commons-compress in order to avoid upgrading commons-compress dependency just for Testcontainers usage. If the upgrade is needed because of other reasons, new Testcontainers will still play well with it for the reasons explained in previous comment. Also, we want to reduce the impact in projects such as Spring Boot and others.
Thanks everyone!
Reacted by D3ns0n, Andy Wilkinson, bonndan, Anoop Narang, Daniel Haferkorn and Julius
Activity
d3ns0n commentedon Jan 29, 2024
I do have the same problem on MacOS
eddumelendez commentedon Jan 29, 2024
It fails because of the change in commons-compress. See diff apache/commons-compress@rel/commons-compress-1.24.0...rel/commons-compress-1.25.0#diff-19b93108b5b4d5b1f4826b7dce61b416beb5a02d928ae8868412d971601ab201R568. If the version is updated then all should be fine.
anoopnarang commentedon Jan 31, 2024
In my project, commons-compress brought in via testcontainers (1.25) was conflicting with the one brought in via hadoop-commons (1.21). Making an exclusion on hadoop-commons fixes the issue.
But it kind of brings another issue ( tentative ), as excluding a transitive dependency in main to fix something for test.
wilkinsona commentedon Feb 4, 2024
We've also been affected by this in Spring Boot's build. There's an awkward combination of main and test dependency versions and dealing with deprecation warnings that I haven't managed to find a good way to address.
Could Testcontainers shade commons-compress?
d3ns0n commentedon Feb 5, 2024
@eddumelendez @anoopnarang thank you for the hint. I added commons-compress:1.25.0 as an explicit dependency to my project. Now everything is fine again 👍
eddumelendez commentedon Feb 7, 2024
@wilkinsona sorry about the issue. So far, we can not shade the dependency because it is part of the public API 😢 . What I was thinking is downgrade the dependency so
public void putArchiveEntry(final ArchiveEntry archiveEntry)still supportsTarArchiveEntry. I've tested some examples with combination of Testcontainers 1.19.3 (with commons-compress 1.23.0) and commons-compress 1.25.0 and works. LMK if this would help.wilkinsona commentedon Feb 7, 2024
Hey, Eddu. We did manage to work around this in the end in our build with some Gradle gymnastics. That said, a downgrade would help us and allow us to simplify the build a bit. I think it may also help Maven users where version conflicts are resolved by nearest to the root of the graph rather than the highest wins that Gradle uses. This means that Maven projects that use Commons Compress and Maven are more likely to end up with an older version of Commons Compress with which Testcontainers isn't compatible. Perhaps the upgrade to the latest version could then be done in Testcontainers 1.20?
Downgrade commons-compress version to 1.24.0
Downgrade commons-compress version to 1.24.0 (#8284)
eddumelendez commentedon Feb 7, 2024
We are going to release a new version downgrading commons-compress in order to avoid upgrading commons-compress dependency just for Testcontainers usage. If the upgrade is needed because of other reasons, new Testcontainers will still play well with it for the reasons explained in previous comment. Also, we want to reduce the impact in projects such as Spring Boot and others.
Thanks everyone!
eddumelendez commentedon Feb 8, 2024
Testcontainers 1.19.5 is available https://repo1.maven.org/maven2/org/testcontainers/testcontainers-bom/1.19.5/
deps: Update testcontainers-java monorepo to v1.19.7 (main) (#17409)
deps: Update testcontainers-java monorepo to v1.19.7 (main) (#17409)
deps: Update dependency org.testcontainers:elasticsearch to v1.19.7 (…
deps: Update dependency org.testcontainers:elasticsearch to v1.19.7 (…
Downgrade commons-compress version to 1.24.0 (testcontainers#8284)
joaovieira-ca commentedon Jun 26, 2025
Can we upgrade this now? The version
1.24.0has a vunerability and we need to update it to at least1.26.0(the latest is1.27.1.I could override it in my project, but I would prefer to have it here as well.
Thank you.