testcontainers / testcontainers/testcontainers-java

[Bug]: Container startup failed for image docker/compose:1.29.2 - Status 500 unexpected EOF

Open
#9,071 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Module

Core

Testcontainers version

1.20.1

Using the latest Testcontainers version?

Yes

Host OS

Mac OS

Host Arch

x86 Intel

Docker version
docker version
Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:04:20 2023
 OS/Arch:           darwin/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.26.1 (131620)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:02 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0


### What happened?

When running integration tests I get the following.
We have 4 other repos with similar structure and do not get this - but reproducible on Mac and Linux (Github action)



### Relevant log output

```shell
Moved from 1.18.0 (where it worked) to 1.20.1 (where I got the following)


                   Caused by:
                    org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker/compose:1.29.2
                        at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
                        at app//org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
                        at app//org.testcontainers.containers.ContainerisedDockerCompose.invoke(ContainerisedDockerCompose.java:84)
                        at app//org.testcontainers.containers.ComposeDelegate.runWithCompose(ComposeDelegate.java:241)
                        at app//org.testcontainers.containers.ComposeDelegate.createServices(ComposeDelegate.java:163)
                        at app//org.testcontainers.containers.DockerComposeContainer.start(DockerComposeContainer.java:139)
                        at app//com.cogito.platform.mapping.AbstractIntegrationTest.<clinit>(AbstractIntegrationTest.java:92)
                        ... 103 more

                        Caused by:
                        org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
                            at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
                            at app//org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
                            ... 109 more

                            Caused by:
                            org.testcontainers.containers.ContainerLaunchException: Could not create/start container
                                at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
                                at app//org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
                                at app//org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
                                ... 110 more

                                Caused by:
                                com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"unexpected EOF"}
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:247)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.put(DefaultInvocationBuilder.java:223)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:34)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.CopyArchiveToContainerCmdExec.execute(CopyArchiveToContainerCmdExec.java:13)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
                                    at app//org.testcontainers.shaded.com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl.exec(CopyArchiveToContainerCmdImpl.java:162)
                                    at app//org.testcontainers.containers.ContainerState.copyFileToContainer(ContainerState.java:370)
                                    at app//org.testcontainers.containers.ContainerState.copyFileToContainer(ContainerState.java:331)
                                    at java.base@17.0.9/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
                                    at app//org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:441)


### Additional Information

_No response_

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 with GenericContainer.tryStart and ContainerState.copyFileToContainer in the stack trace, then reproduce the failure using docker/compose:1.29.2 under Testcontainers 1.20.1 and compare it with 1.18.0. Trace the Docker archive-copy request that returns the unexpected EOF; done means the affected integration tests start the compose container successfully on the reported environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.