-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
depends_on required property error #10804
Comments
👋 @ShahimEssaid |
If that implementation is still in progress, why was the previous behavior not continued until then? My setup is now broken with no option to enable the previous behavior. This is not good. To clarify, I had a setup where several services might be active or not based on profiles and the depends_on helped with ordering them as needed if they are active. Now, that setup is broken. I'll try dropping down to a previous docker/compose versions for now as a workaround. |
The main reason here is that we fixed the behaviour of |
I understand that you fixed the previous implementation but now the specification has another item that the implementation is not compliant with. So, the implementation is still not according to the spec anyway so why not keep the old behavior as well until both issues are according to the spec? Anyway, the fix is easy for me for now. I've downgraded to Docker Compose version v2.18.1 and all is good for now. Yes, you can close but if the fix is not going to be in the next release maybe you can consider reverting the fix until both fixes are in a release. |
@glours I just encountered this error today with a very simple project in GitHub Actions. I'm having trouble following the who/where/why of this^ discussion, but I'm pretty sure that my case does not depend on "using a bug as a feature", so hoping we can get this reopened for some more attention on this issue. $ docker compose config | docker buildx bake --file - --push
ERROR: failed to parse -: parsing yaml: validating : services.fetch.depends_on.otel Additional property required is not allowed, parsing hcl: -.hcl:10,73-74: Invalid character; This character is not used within the language., and 23 other diagnostic(s) # original syntax fails
services:
fetch:
depends_on:
- otel
otel: # partial extended syntax fails
services:
fetch:
depends_on:
otel:
condition: service_healthy
otel: # full extended syntax fails
services:
fetch:
depends_on:
otel:
condition: service_healthy
required: true
otel: on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2.9.1
- run: docker compose config | docker buildx bake --file - --push
|
Hey @austindrenski Edit: I reproduced the issue and confirm bake won't be able to parse correctly compose file with |
The PR to bump |
Thanks, @glours! That's awesome, can't tell you how much I appreciate your quick response and assist! |
Oh nice, I ran into the same issue as well, I will wait for the PR to get merged. |
Description
The handling of depneds_on when the referenced service is not active (due to profiles in my case) has changed. It used to ignore the missing service but now with the latest compose it is an error if the referenced service is not active. But, I noticed the new "required" property to enable the previous behavior. However, this property is causing
Additional property required is not allowed
Steps To Reproduce
Environment:
Ubuntu 22.04 with Docker installed from Docker repositories.
Docker Compose version v2.19.1
Docker version 24.0.4, build 3713ee1
With example compose.yaml:
Run:
09:40 $ docker compose up
Error:
validating /home/essaids/git/gh/se/hapi-server-setup/tmp/dc1/compose.yaml: services.second.depends_on.first Additional property required is not allowed
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: