testcontainers / testcontainers/testcontainers-java

Container with new ImageFromDockerfile().withDockerfile(...) cause java.lang.IllegalArgumentException: group id '...' is too big ( > 2097151 ). Use STAR or POSIX extensions to overcome this limit

Open
#4,701 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

I upgraded the testcontainers version from 1.15.3 to 1.16.2.

When I try to run test now I am getting:

Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=, imagePullPolicy=DefaultPullPolicy())
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1326)
at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:643)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:326)
... 37 more
Caused by: java.lang.IllegalArgumentException: group id '34548085' is too big ( > 2097151 ). Use STAR or POSIX extensions to overcome this limit
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumber(TarArchiveOutputStream.java:651)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumberWithPosixMessage(TarArchiveOutputStream.java:644)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.failForBigNumbers(TarArchiveOutputStream.java:626)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.putArchiveEntry(TarArchiveOutputStream.java:377)
at org.testcontainers.shaded.com.github.dockerjava.core.util.CompressArchiveUtil.addFileToTar(CompressArchiveUtil.java:41)
at org.testcontainers.shaded.com.github.dockerjava.core.util.CompressArchiveUtil.archiveTARFiles(CompressArchiveUtil.java:106)
at org.testcontainers.shaded.com.github.dockerjava.core.dockerfile.Dockerfile$ScannedResult.buildDockerFolderTar(Dockerfile.java:134)
at org.testcontainers.shaded.com.github.dockerjava.core.dockerfile.Dockerfile$ScannedResult.buildDockerFolderTar(Dockerfile.java:124)
at org.testcontainers.shaded.com.github.dockerjava.core.command.BuildImageCmdImpl.withDockerfile(BuildImageCmdImpl.java:346)
at org.testcontainers.shaded.com.github.dockerjava.core.command.BuildImageCmdImpl.withDockerfile(BuildImageCmdImpl.java:23)
at org.testcontainers.images.builder.ImageFromDockerfile.lambda$configure$0(ImageFromDockerfile.java:154)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at org.testcontainers.images.builder.ImageFromDockerfile.configure(ImageFromDockerfile.java:153)
at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:109)
at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:37)
at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:17)
at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:39)
at org.testcontainers.shaded.com.google.common.util.concurrent.Futures$3.get(Futures.java:1332)
at org.testcontainers.images.RemoteDockerImage.getImageName(RemoteDockerImage.java:115)
at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:64)
at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:28)
at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:17)
at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:39)
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1324)
... 39 more

I am using ImageFromDockerfile().withDockerfile(Path.of("./../some_path/Dockerfile")) to create the container.
What I see it fails on:

org.testcontainers.shaded.com.github.dockerjava.core.dockerfile.Dockerfile.ScannedResult#buildDockerFolderTar(java.io.File)

Previously, when I was using version 1.15.3 it was working fine. Note: I am running on MacOs, on Linux it works fine.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at org.testcontainers.shaded.com.github.dockerjava.core.dockerfile.Dockerfile.ScannedResult#buildDockerFolderTar(java.io.File) and the ImageFromDockerfile().withDockerfile(Path...) entry point. Reproduce the failure on macOS with versions 1.15.3 and 1.16.2, comparing the Linux behavior described in the report. Done means building the Dockerfile archive no longer fails on the reported large group ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.