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

service "electric-with-postgres" can't be used with extends as it declare depends_on #1018

Closed
AntonOfTheWoods opened this issue Feb 29, 2024 · 4 comments · Fixed by #1025
Closed
Assignees

Comments

@AntonOfTheWoods
Copy link
Contributor

PUPPETEER_SKIP_DOWNLOAD=true npx create-electric-app@latest ntcr --template react
cd ntcr && npx electric-sql start --with-postgres

Starting ElectricSQL sync service with PostgreSQL
Docker compose config: {
  SERVICE: 'http://localhost:5133',
...
  LOGICAL_PUBLISHER_HOST: 'electric'                                                                                                                          
}                                                                                                                                                             
service "electric-with-postgres" can't be used with `extends` as it declare `depends_on`                                                                      
Failed to start the Electric backend. Check the output from 'docker compose' above. If the error message mentions a port already being allocated or address be
ing already in use, please change the configuration to an alternative port via the ELECTRIC_HTTP_PORT or ELECTRIC_PG_PROXY_PORT environment variables.

Looks related to docker/compose#11544

@AntonOfTheWoods
Copy link
Contributor Author

AntonOfTheWoods commented Mar 2, 2024

I can confirm that this is definitely a bug and definitely the problem. Removing the depends allows everything to start as expected, and the current config is not valid docker compose config. It previously worked but no longer does with the most recent versions of compose released by Docker.

@samwillis
Copy link
Contributor

@AntonOfTheWoods thanks for the report. Yep, we were using extends to overcome a limitation in configuring depends_on for different profiles. It looks like Docker have decided that that what we were doing is not valid even though it worked for us before. I've opened a PR #1025 to simplify our docker compose files with no inheritance.

@AntonOfTheWoods
Copy link
Contributor Author

AntonOfTheWoods commented Mar 4, 2024

Yeah, apparently they are now actively checking for unsupported config options that used to work, but only by accident. Thanks for the fix!

samwillis added a commit that referenced this issue Mar 4, 2024
… docker-compose files (#1025)

Fixes #1018

This removes the inheritance from the docker compose files. There are
now two mostly duplicated compose files, with the "with-postgres" file
have this addition for the electric service:

```
depends_on:
      - postgres
```

Not pretty, but works and is far less likely to break with future
versions of Docker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants