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

Invalid compose file because networks structure is wrong #334

Closed
xaabi6 opened this issue Nov 4, 2021 · 12 comments
Closed

Invalid compose file because networks structure is wrong #334

xaabi6 opened this issue Nov 4, 2021 · 12 comments
Assignees

Comments

@xaabi6
Copy link

xaabi6 commented Nov 4, 2021

Describe the bug
With the change introduced in commit Update the network structure, I get the following error:

ERROR: The Compose file '/srv/server/proxy/compose/bin/..//docker-compose.yml' is invalid because:
networks.default value Additional properties are not allowed ('name' was unexpected)

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository
  2. cd to ./bin inside the cloned repository folder
  3. Execute fresh-start.sh

Expected behavior
It should read it and continue without failing.

Server info:

  • Linux release: Debian 9 (stretch)
  • Server type: ODROID-C2
  • Docker version: 19.03.15
  • docker-compose version: 1.25.4
@evertramos
Copy link
Owner

evertramos commented Nov 5, 2021

Update the docker version to 20

or use release v0.6

@allanext
Copy link

allanext commented Nov 11, 2021

@xaabi6 @evertramos my version of docker is 20 but I got the same issue

docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

It was resolved by checking out version 0.6

@xaabi6
Copy link
Author

xaabi6 commented Nov 12, 2021

I finally reverted Update the network structure and everything went fine for me @allanext, but it's quite interesting to know that it's not working for you in docker version 20.

@evertramos
Copy link
Owner

evertramos commented Nov 12, 2021

@xaabi6 and @allanext my bad... I was in a hurry, just wanted you to fix the issue.

But the message you received was from docker-compose not docker, so the version you are using of docker-compose 1.

This new structure is for version 2.

I will add to the home a version compatibility soon.

Sorry for the hurry again!

@evertramos evertramos pinned this issue Nov 12, 2021
@xaabi6
Copy link
Author

xaabi6 commented Nov 13, 2021

Thanks for the clarification @evertramos, I never thought the culprit would be the docker-compose version but it makes sense because otherwise it would have worked for @allanext.

@mlysle
Copy link

mlysle commented Dec 5, 2021

For anyone still having trouble, you need to install compose switch: https://docs.docker.com/compose/cli-command/#compose-switch
You can install it in one command. Then docker-compose will use v2.

@allanext
Copy link

allanext commented Dec 9, 2021

@xaabi6 @evertramos I've set docker-compose 2 and I still have the network error:

~/docker/proxy/bin$ docker-compose -v
Docker Compose version v2.0.1
~/docker/proxy/bin$ docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

with the trunk i get:

git clone --recurse-submodules https://github.com/evertramos/nginx-proxy-automation.git proxy 
./fresh-start.sh --yes -e email@domain --skip-docker-image-check

 ✔ success Function 'file_comment_line_with_string'
 ✔ success Function 'file_comment_line_with_string'
 ✔ success Function 'local_update_docker_compose_file'
network proxy declared as external, but could not be found
 ✔ success Function 'docker_compose_start'
 ✘ ERROR   There was an error starting the service at '/home/user/docker/proxy/bin/../'

with the tag git checkout tags/v0.6 i get two warnings:

./fresh-start.sh --yes -e email@domain --skip-docker-image-check
⚡ Start execution './bin/fresh-start.sh  ✔ success Function 'check_local_env_file'
 ✔ success Function 'check_docker'
 ✔ success Function 'check_running_script'
 ✔ success Function 'starts_initial_check'
WARN[0000] network default: network.external.name is deprecated in favor of network.name 
 ✔ success Function 'docker_compose_check_service_exists'

...

 ✔ success Function 'file_comment_line_with_string'
 ✔ success Function 'local_update_docker_compose_file'
WARN[0000] network default: network.external.name is deprecated in favor of network.name 
network proxy declared as external, but could not be found
 ✔ success Function 'docker_compose_start'
 ✘ ERROR   There was an error starting the service at '/home/user/docker/proxy/bin/../'

I've also installed docker-switch as suggested by @mlysle:

curl -fL https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh

@allanext
Copy link

@xaabi6 @evertramos removing network: external worked for me

@allanext
Copy link

@xaabi6 @evertramos I've just installed a fresh version and the issue is still there.

Shouldn't network: external be commented out on the master branch?

@evertramos
Copy link
Owner

evertramos commented Jan 19, 2022

@allanext what version of docker-compose do you have installed?

ref. #334 (comment)

@allanext
Copy link

Hi @evertramos here are the versions:

Docker Compose version v2.0.1
user@ubuntu:~$ docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2
user@ubuntu:~$ uname -a
Linux 5.4.0-92-generic #103-Ubuntu SMP Fri Nov 26 16:13:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux```

@evertramos
Copy link
Owner

@allanext not sure what would cause that... I will check this when I get the time, but this network structure is external, so it must be informed in our compose, once the network may already exist, when I get a chance I will come back to this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants