Closed powerbsd closed 1 year ago
Can you do a docker-compose version in here?
And it would be nice if you gave us some system informations.
I'm getting a similar error:
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo ./update.sh
Checking internet connection... OK
Checking for newer update script...
Updated 0 paths from e46f42fe
Are you sure you want to update mailcow: dockerized? All containers will be stopped. [y/N] y
Great! Native IPv6 NAT is active.
Fetching new docker-compose version...
Trying to determine GLIBC version...
Validating docker-compose stack configuration...
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
Oh no, something went wrong. Please check the error message above.
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo docker compose version
Docker Compose version v2.6.0
sven@docker-prod02:/srv/docker/mailcow-dockerized$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo grep ^HTTP mailcow.conf
HTTP_PORT=80
HTTP_BIND=
HTTPS_PORT=443
HTTPS_BIND=```
I see, but can you do a docker-compose version? Important with the - here
I see, but can you do a docker-compose version? Important with the - here
No problem:
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo docker-compose version
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.0
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
sven@docker-prod02:/srv/docker/mailcow-dockerized$ ls -l `which docker-compose`
-rwxr-xr-x 1 root root 215 Jun 6 20:51 /usr/local/bin/docker-compose
Ok, in normal cases the update.sh script should update your docker-compose Version. That is the reason why its throwing out this issue.
Can you do a git diff origin/master update.sh
please?
Can you do a
git diff origin/master update.sh
please?
No differences.
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo git diff origin/master update.sh
sven@docker-prod02:/srv/docker/mailcow-dockerized$
Perhaps check the location of docker-compose
and your $PATH
sudo -i
which docker-compose
echo $PATH
Can you run the update.sh Script as root not via sudo?
And don't use sudo update.sh
or even try to control mailcow with it.
The environment may not be the same as it is for root if you "misuse" sudo. Some important variables or aliases you may have set are not always inherited into the child process.
I see, but can you do a docker-compose version? Important with the - here
No problem:
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo docker-compose version docker-compose version 1.29.2, build unknown docker-py version: 5.0.0 CPython version: 3.8.10 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 sven@docker-prod02:/srv/docker/mailcow-dockerized$ ls -l `which docker-compose` -rwxr-xr-x 1 root root 215 Jun 6 20:51 /usr/local/bin/docker-compose
Try this please:
curl -L https://github.com/docker/compose/releases/download/v$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/v$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
Thank you! That solved the problem. Strange, I don't remember doing anything with docker-compose lately.
I ran into the same issue, and upgrading docker-compose as above solved it. Looks like upgrade of docker-compose is mandatory already now.
I ran into a similiar issue today:
ERROR: The Compose file './docker-compose.yml' is invalid because: services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
I am using ubuntu 22.04 with docker installed as a snap. I also tried "the edge" version:
$docker-compose --version docker-compose version 1.29.2, build unknown`
I was able to solve this issue by reverting a139eb9bce925e66a99639efd4b1027e020ac26a. I remembered, that it was working perfectly fine with the same setup a few weeks ago so I just checked what changed in the file, with git log.
Edit: the output of:
$ docker compose version Docker Compose version v2.5.0
I don't think it's a good idea to mix Docker Compose version 1 and 2. When calling docker-compose
version 1 should be used when calling docker compose
version 2. Just my 2 cents.
We dont mix things up. It is still docker-compose. Its downloads (currently 2.6.0) from the update.sh Script since it is now used for mailcow to operate the whole stack.
I ran into a similiar issue today:
ERROR: The Compose file './docker-compose.yml' is invalid because: services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
I am using ubuntu 22.04 with docker installed as a snap. I also tried "the edge" version:
$docker-compose --version docker-compose version 1.29.2, build unknown`
I was able to solve this issue by reverting a139eb9. I remembered, that it was working perfectly fine with the same setup a few weeks ago so I just checked what changed in the file, with git log.
Edit: the output of:
$ docker compose version Docker Compose version v2.5.0
The update process includes a update of the docker-compose Version. It works on all tested machines and all of the Telegram Users. How did you run the Update Script?
How did you run the Update Script?
sudo su
cd /opt/mailcow-dockerized
./update.sh
Tried to update today. I have got the same issue.
cd /opt/mailcow-dockerized
./update.sh
./update.sh
and this is the output
Checking internet connection... OK
Checking for newer update script...
Updated 0 paths from cedcf9b9
Are you sure you want to update mailcow: dockerized? All containers will be stopped. [y/N] y
Great! Native IPv6 NAT is active.
Fetching new docker-compose version...
Trying to determine GLIBC version...
Validating docker-compose stack configuration...
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
Oh no, something went wrong. Please check the error message above.
Two different machines. docker-compose version 1.29.2
services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
I also had this error. But after setting HTTP_BIND
and HTTPS_BIND
in .env
to an IP, this disappeared.
I don't know if this is expected, too.
I have fixed that by uninstalling docker-compose installed from pip. Letting the mailcow ./update.sh script install the newest one.
I have fixed that by uninstalling docker-compose installed from pip. Letting the mailcow ./update.sh script install the newest one.
Solved it for me, too.
This comment would have been more appropriate on another thread, but I'm unable to post there so I'm posting this here.
What I don't understand is that now that the docker-compose-plugin
is available via apt
, from the same repo as containerd.io
and docker-ce
, why isn't Mailcow simply installing it via:
apt install docker-compose-plugin
And then using it via the new syntax, eg:
docker compose --help
Usage: docker compose [OPTIONS] COMMAND
Docker Compose
Options:
--ansi string Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
--compatibility Run compose in backward compatibility mode
--env-file string Specify an alternate environment file.
-f, --file stringArray Compose configuration files
--profile stringArray Specify a profile to enable
--project-directory string Specify an alternate working directory
(default: the path of the, first specified, Compose file)
-p, --project-name string Project name
Commands:
build Build or rebuild services
convert Converts the compose file to platform's canonical format
cp Copy files/folders between a service container and the local filesystem
create Creates containers for a service.
down Stop and remove containers, networks
events Receive real time events from containers.
exec Execute a command in a running container.
images List images used by the created containers
kill Force stop service containers.
logs View output from containers
ls List running compose projects
pause Pause services
port Print the public port for a port binding.
ps List containers
pull Pull service images
push Push service images
restart Restart containers
rm Removes stopped service containers
run Run a one-off command on a service.
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker Compose version information
Run 'docker compose COMMAND --help' for more information on a command.
Wouldn't work in my case - using CentOS not Ubuntu/Debian.
@mintalicious how do you install docker-ce
? If you use yum
I don't see why you couldn't install it from the Docker repo since it is available? See the instructions for configuring the repo.
I didn't know that mailcow differentiates between the unique operating system families for installing and upgrading its services in containers.
@mintalicious it doesn't, but Docker Compose isn't installed into a container and Mailcow doesn't install docker-ce
... and since docker-compose-plugin
can be now installed and upgraded using the same method as used for docker-ce
(apt
or yum
or whatever) it would seem sensible to me to simply remove docker-compose
version 1.x and ask users to install docker-compose-plugin
using the same method as they use for docker-ce
:man_shrugging:.
But it upgrades docker-compose.
I know but I'm suggesting that we could use the same method for installing and upgrading docker-compose-plugin
as we use for docker-ce
and this would save having to have any Mailcow code for installing / upgrading Docker Compose -- it would simply need to check that the plugin is installed.
Of course there could be future issues with upstream incompatibilities with new versions, but this is already the case for docker-ce
and other things that Mailcow depends on...
@mintalicious it doesn't, but it also doesn't install
docker-ce
... and sincedocker-compose-plugin
can be now installed and upgraded using the same method (apt
oryum
or whatever) it would seem sensible to me to simply removedocker-compose
version 1.x and ask users to installdocker-compose-plugin
using the same method as they use fordocker-ce
man_shrugging.
I understand your point using docker-compose from the system's package (which would actually work for me), but maybe there are users who don't do a system upgrade periodically or even before every mailcow update. And mailcow must check and ensure that it can use at least the docker-compose version it requires.
A Mailcow check for the version:
docker compose version
Docker Compose version v2.6.0
And then Mailcow refusing to do anything if the version is not the minimum required would be fine as far as I'm concerned, in fact I think it would be good to prompt "users who don't do a system upgrade periodically" to update things!
Just to chime in out of nowhere... as long as there is no bleeding edge requirement, a little prod to update to a more recent one can't harm too much right? Although I do feel Mailcow shouldn't force / require an update unless it requires a feature or bugfix from a newer Docker compose to work reliably.
It is perhaps worth noting that the Mailcow install instructions contain the suggestion that the Docker install script should be used to install docker-ce
:
curl -sSL https://get.docker.com/ | CHANNEL=stable sh
And the script that is served at that URL contains code to automatically install the docker-compose-plugin
if the version of Docker is greater than 20.10 (the latest is 20.10.17).
And the statement that:
Package managers (e.g.
apt
,yum
) likely won't give you the correct version.
Is probably no longer true, as long as the docker-compose-plugin
package is installed using a package manager or the current Docker install.sh
script.
Yeah it has been done due to several reasons:
However if you want feel free to open up a PR which includes a check for the Repo Version of Compose v2.
Chiming in as an Alpine user, this wasn't very smooth as even Alpine edge only has 1.29.2-r2 and pip didn't work for me either.
For anyone else reading this: I removed docker-compose, re-added the dependencies, and manually grabbed the standalone from docker.
apk del docker-compose
apk add py3-cached-property py3-chardet py3-distro py3-dockerpty docker-py dockerpy-creds py3-docopt py3-ipaddress py3-jsonschema py3-pyrsistent py3-attrs py3-paramiko py3-asn1 py3-cryptography py3-bcrypt py3-pynacl py3-cffi py3-cparser py3-pysocks py3-dotenv py3-yaml py3-requests py3-certifi py3-charset-normalizer py3-idna py3-urllib3 py3-texttable py3-websocket-client yaml
curl -SL https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
./update.sh worked after that and everything is showing up and running.
I ran into a similiar issue today:
ERROR: The Compose file './docker-compose.yml' is invalid because: services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
I am using ubuntu 22.04 with docker installed as a snap. I also tried "the edge" version:
$docker-compose --version docker-compose version 1.29.2, build unknown`
I was able to solve this issue by reverting a139eb9. I remembered, that it was working perfectly fine with the same setup a few weeks ago so I just checked what changed in the file, with git log. Edit: the output of:
$ docker compose version Docker Compose version v2.5.0
The update process includes a update of the docker-compose Version. It works on all tested machines and all of the Telegram Users. How did you run the Update Script?
Same problem that it doesn't work on a actual OpenSuse Leap installation where docker-compose is taken from openSuse repos. Interesting is, that no error message tells that an installation of docker-compose had a problem.
I'm quite surprised to hear that this mailserver update tries to update basic components of a container machine without any notice before. In my opinion it is not really an ideal way to update such a component by the update process of an application. The component might be used by other containers of a machine. A hint that an update is necessary or additionally a question "do you want to update the docker-compose too" could be a more suitable way...
A hint that an update is necessary or additionally a question "do you want to update the docker-compose too" could be a more suitable way...
I´m implementing it already to the update.sh script. It even detects if your version is up to date so it won´t ask you everytime if there isn´t a new version available.
I´m implementing it already to the update.sh script. It even detects if your version is up to date so it won´t ask you everytime if there isn´t a new version available.
Sounds nice. Does this new version ask you for an update of docker-compose or does it try an update by itself?
Both, if you set: Yes it will update it by it self. If you press No then it won´t update.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Bumping, as it's not resolved.
Which docker compose Version do you have?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I see, but can you do a docker-compose version? Important with the - here
No problem:
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo docker-compose version docker-compose version 1.29.2, build unknown docker-py version: 5.0.0 CPython version: 3.8.10 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 sven@docker-prod02:/srv/docker/mailcow-dockerized$ ls -l `which docker-compose` -rwxr-xr-x 1 root root 215 Jun 6 20:51 /usr/local/bin/docker-compose
Try this please:
curl -L https://github.com/docker/compose/releases/download/v$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
That fixed it for me, even though I had to run the nested command seperately
Thanks a lot @DerLinkman!
I had this issue on a fresh install on Debian 11, using the official mailcow ansible role. I adapted your commands to an ansible task.
pre_tasks:
- name: Fix for mailcow issue (https://github.com/mailcow/mailcow-dockerized/issues/4648#issuecomment-1165816047)
shell: |
curl -L https://github.com/docker/compose/releases/download/v$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
The whole thing seems quite fragile, but it solves my issue for now!
I see, but can you do a docker-compose version? Important with the - here
No problem:
sven@docker-prod02:/srv/docker/mailcow-dockerized$ sudo docker-compose version docker-compose version 1.29.2, build unknown docker-py version: 5.0.0 CPython version: 3.8.10 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020 sven@docker-prod02:/srv/docker/mailcow-dockerized$ ls -l `which docker-compose` -rwxr-xr-x 1 root root 215 Jun 6 20:51 /usr/local/bin/docker-compose
Try this please:
curl -L https://github.com/docker/compose/releases/download/v$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
docker-compose did not upgrade with apt update. and then with the sudo ubuntu account did not execute this line. I had to su - to root and update docker compose and then it was like "It works!"
Thanks
Contribution guidelines
I've found a bug and checked that ...
Description
ERROR: The Compose file './docker-compose.yml' is invalid because: services.nginx-mailcow.ports is invalid: Invalid port ":443:443", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol] services.nginx-mailcow.ports is invalid: Invalid port ":8080:8080", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
Logs
Steps to reproduce
System information
docker version
)docker-compose version
)git describe --tags `git rev-list --tags --max-count=1`
)Output of
git diff origin/master
, any other changes to the code? If so, please post them:All third-party firewalls and custom iptables rules are unsupported. Please check the Docker docs about how to use Docker with your own ruleset. Nevertheless, iptabels output can help us to help you: iptables -L -vn:
ip6tables -L -vn:
iptables -L -vn -t nat:
ip6tables -L -vn -t nat:
DNS problems? Please run
docker exec -it $(docker ps -qf name=acme-mailcow) dig +short stackoverflow.com @172.22.1.254
(set the IP accordingly, if you changed the internal mailcow network) and post the output: