Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot 3.4.1 fails to start on Windows when using docker-compose because of --orphans flag #43811

Closed
boyvanduuren opened this issue Jan 14, 2025 · 7 comments
Labels
status: duplicate A duplicate of another issue

Comments

@boyvanduuren
Copy link

After upgrading to spring boot 3.4.1 my application isn't working anymore on Windows because of an unknown --orphans flag.
I'm using the Docker Desktop version 4.37.1 (178610), which is the latest.

2025-01-14 08:01:24.055 ERROR [traceId=,spanId=] --- [           main] o.s.boot.SpringApplication               :
                    Application run failed

org.springframework.boot.docker.compose.core.ProcessExitException: 'docker compose --file C:\Users\<snip>\app\docker-compose.yml --ansi never --profile local ps --orphans=false --format=json' failed with exit code 16.

Stdout:


Stderr:
unknown flag: --orphans

        at org.springframework.boot.docker.compose.core.ProcessRunner.run(ProcessRunner.java:97)
        at org.springframework.boot.docker.compose.core.DockerCli.run(DockerCli.java:77)
        at org.springframework.boot.docker.compose.core.DefaultDockerCompose.runComposePs(DefaultDockerCompose.java:132)
        at org.springframework.boot.docker.compose.core.DefaultDockerCompose.getRunningServices(DefaultDockerCompose.java:96)
        at org.springframework.boot.docker.compose.lifecycle.DockerComposeLifecycleManager.start(DockerComposeLifecycleManager.java:124)
        at org.springframework.boot.docker.compose.lifecycle.DockerComposeListener.onApplicationEvent(DockerComposeListener.java:53)
        at org.springframework.boot.docker.compose.lifecycle.DockerComposeListener.onApplicationEvent(DockerComposeListener.java:35)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
        at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
        at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:98)
        at org.springframework.boot.SpringApplicationRunListeners.lambda$contextLoaded$4(SpringApplicationRunListeners.java:72)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
        at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
        at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:72)
        at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:416)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:317)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350)
        at nl.<snip>.main(<snip>.java:24)

I think the --orphans flag does not exist on docker-compose for Windows.
The version of docker-compose included in the latest Docker Desktop for Windows is v2.29.7-desktop.1.

Switching back to 4.3.0 fixes the issue. Colleagues on Windows using Rancher Desktop, or colleagues using MacOS do not have this issue.

I saw some recent (fixed) issues related to the use of --orphans that might have introduced this issue:
#43710
#40139

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 14, 2025
@bclozel
Copy link
Member

bclozel commented Jan 14, 2025

Hello @boyvanduuren
Can you replicate the same behavior on the CLI directly with docker desktop? Can you share the output of:

$ docker compose ps --orphans
$ docker compose version

The minimum requirement should be docker compose 2.24 as this feature was introduced in docker/compose@caa0cbb. I don't see any sign pointing to this feature not being available on windows.

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Jan 14, 2025
@quaff
Copy link
Contributor

quaff commented Jan 14, 2025

@boyvanduuren Please try 3.4.2-SNAPSHOT, it's fixed by #43717.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 14, 2025
@bclozel

This comment has been minimized.

@bclozel bclozel added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 14, 2025
@boyvanduuren
Copy link
Author

Hi @bclozel, I mentioned the docker-compose version in the bug report. It is v2.29.7-desktop.1.

It seems the version returned by docker compose is different than is being returned from docker-compose though:

❯ docker compose version
Docker Compose version v2.11.1

❯ docker-compose --version
Docker Compose version v2.29.7-desktop.1

Both are provided by the Docker Desktop installation though:

❯ Get-Command docker

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     docker.exe                                         0.0.0.0    C:\Program Files\Docker\Docker\resources\bin\docker.exe

❯ Get-Command docker-compose

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     docker-compose.exe                                 0.0.0.0    C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe

I can confirm that --orphans works when passing it to docker-compose, but not to docker compose:

❯ docker compose ps --orphans
unknown flag: --orphans

❯ docker-compose ps --orphans
no configuration file provided: not found

There's a chance that this is now broken for people using Docker Desktop for Windows. I checked with one other colleague that uses it and has the same issue.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 14, 2025
@wilkinsona
Copy link
Member

Thanks, @boyvanduuren. Spring Boot calls docker compose so it's that version that matters. As you're running 2.11.1, #43717 should help here. Please try 3.4.2-SNAPSHOT that's available from https://repo.spring.io/snapshot.

@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 14, 2025
@boyvanduuren
Copy link
Author

I can confirm 3.4.2-SNAPSHOT is working!

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 14, 2025
@wilkinsona
Copy link
Member

Thanks for letting us know, @boyvanduuren.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

5 participants