testcontainers / testcontainers/testcontainers-java
DockerComposeContainer fails on startup with TooLongFrameException
Open
Nobody has claimed this yet.
area/docker-compose
resolution/acknowledged
type/bug
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
I am getting this error when starting up TestContainers with DockerComposeContainer. This error occurs with even the simplest docker-compose.yml file containing only a single container. I am using this to start:
@ClassRule
public static DockerComposeContainer vsenvironment = new DockerComposeContainer(new File("src/test/resources/compose-smoke.yml"))
.withExposedService("smokehr_1",8080,Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(600)))
.withLocalCompose(false)
.withPull(true)
.withTailChildContainers(false);
The error looks like this:
14:34:49.095 [Test worker] INFO org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy - Found docker client settings from environment
14:34:49.123 [Test worker] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with Environment variables, system properties and defaults. Resolved:
dockerHost=unix:///var/run/docker.sock
apiVersion='{UNKNOWN_VERSION}'
registryUrl='https://index.docker.io/v1/'
registryUsername='gradle'
registryPassword='null'
registryEmail='null'
dockerConfig='DefaultDockerClientConfig[dockerHost=unix:///var/run/docker.sock,registryUsername=gradle,registryPassword=<null>,registryEmail=<null>,registryUrl=https://index.docker.io/v1/,dockerConfig=/home/gradle/.docker,sslConfig=<null>,apiVersion={UNKNOWN_VERSION}]'
14:36:07.841 [Test worker] INFO org.testcontainers.DockerClientFactory - Docker host IP address is 172.17.0.1
14:36:10.944 [Test worker] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 18.03.1-ce
API Version: 1.37
Operating System: Container Linux by CoreOS 1745.7.0 (Rhyolite)
Total Memory: 5963 MB
14:36:18.332 [Test worker] INFO org.testcontainers.DockerClientFactory - Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
ℹ︎ Checking the system...
✔ Docker version should be at least 1.6.0
✔ Docker environment should have more than 2GB free disk space
✔ File should be mountable
14:36:22.504 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Creating container for image: docker/compose:1.8.0
14:36:22.690 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Starting container with ID: 7d84c971e786dff45d1f8a0dc87114c14cfcc05ed7a1eb1c412290ef7c13b410
14:36:23.516 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Container docker/compose:1.8.0 is starting: 7d84c971e786dff45d1f8a0dc87114c14cfcc05ed7a1eb1c412290ef7c13b410
14:36:24.541 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Container docker/compose:1.8.0 started
14:36:24.551 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Docker Compose container is running for command: pull
14:36:24.570 [dockerjava-netty-1-5] INFO 🐳 [docker/compose:1.8.0] - STDERR: Pulling smokehr (registry:5000/memuser:latest)...
14:36:24.570 [dockerjava-netty-1-5] INFO 🐳 [docker/compose:1.8.0] - STDOUT: latest: Pulling from memuser
14:36:24.571 [dockerjava-netty-1-5] INFO 🐳 [docker/compose:1.8.0] - STDOUT: Digest: sha256:de75673d3a8adfea8cfd65d4a2b8dfba528a0d53047d62e502c62837e442a7bb
14:36:24.575 [dockerjava-netty-1-5] INFO 🐳 [docker/compose:1.8.0] - STDOUT: Status: Image is up to date for registry:5000/memuser:latest
14:36:24.580 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Docker Compose has finished running
14:36:24.598 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Creating container for image: docker/compose:1.8.0
14:36:24.783 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Starting container with ID: 886d4381f3166d8667ea21ee554c6b69e438117733d7d5090b3409e7d1bf8ea8
14:36:25.356 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Container docker/compose:1.8.0 is starting: 886d4381f3166d8667ea21ee554c6b69e438117733d7d5090b3409e7d1bf8ea8
14:36:31.373 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Container docker/compose:1.8.0 started
14:36:31.375 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Docker Compose container is running for command: up -d
14:36:31.378 [dockerjava-netty-1-6] INFO 🐳 [docker/compose:1.8.0] - STDERR: Creating network "kesfztmnswhu_default" with the default driver
14:36:31.378 [dockerjava-netty-1-6] INFO 🐳 [docker/compose:1.8.0] - STDERR: Creating kesfztmnswhu_smokehr_1
14:36:31.382 [Test worker] INFO 🐳 [docker/compose:1.8.0] - Docker Compose has finished running
14:36:31.391 [Test worker] INFO 🐳 [alpine/socat:latest] - Creating container for image: alpine/socat:latest
14:36:31.670 [Test worker] INFO 🐳 [alpine/socat:latest] - Starting container with ID: 9869b1425868e3f47c75873178f441e2bf408f99393413bbe8b8e77dab4ab917
14:36:42.974 [Test worker] INFO 🐳 [alpine/socat:latest] - Container alpine/socat:latest is starting: 9869b1425868e3f47c75873178f441e2bf408f99393413bbe8b8e77dab4ab917
14:36:43.452 [Test worker] INFO 🐳 [alpine/socat:latest] - Container alpine/socat:latest started
14:36:44.493 [dockerjava-netty-1-7] ERROR com.github.dockerjava.core.async.ResultCallbackTemplate - Error during callback
org.testcontainers.shaded.io.netty.handler.codec.TooLongFrameException: object length exceeds 1048576: 1056099 bytes discarded
at org.testcontainers.shaded.io.netty.handler.codec.json.JsonObjectDecoder.decode(JsonObjectDecoder.java:106)
at org.testcontainers.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
at org.testcontainers.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
at org.testcontainers.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:72)
at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:33)
at org.testcontainers.shaded.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.testcontainers.shaded.io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.testcontainers.shaded.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at org.testcontainers.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at org.testcontainers.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at org.testcontainers.shaded.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at org.testcontainers.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at org.testcontainers.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at org.testcontainers.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at org.testcontainers.shaded.io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:997)
at org.testcontainers.shaded.io.netty.channel.epoll.EpollDomainSocketChannel$EpollDomainUnsafe.epollInReady(EpollDomainSocketChannel.java:138)
at org.testcontainers.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:401)
at org.testcontainers.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:306)
at org.testcontainers.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at org.testcontainers.shaded.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DockerComposeContainer and reproduce the failure using the compose-smoke.yml configuration and the shown startup options. Trace the startup path around the TooLongFrameException and verify the simple Docker Compose case completes without this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, java
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100