evertramos / nginx-proxy-automation

Automated docker nginx proxy integrated with letsencrypt.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid compose file because networks structure is wrong

xaabi6 opened this issue · comments

commented

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

Update the docker version to 20

or use release v0.6

@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

commented

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.

@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!

commented

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.

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.

@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

@xaabi6 @evertramos removing network: external worked for me

@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?

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

ref. #334 (comment)

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```

@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.