bitwarden / self-host

Bitwarden's self-hosted release repository
GNU General Public License v3.0
331 stars 60 forks source link

"WARN docker-compose.yml: `version` is obsolete" when starting or stopping bitwarden #232

Closed vinnyperella closed 5 months ago

vinnyperella commented 6 months ago

This is low priority as it doesn't appear to cause any issues and is just a WARN but it might confuse people and make them think there's an issue. I updated my docker compose to v2.25.0 which is the latest version and when I ran "./bitwarden.sh stop" or "./bitwarden.sh start" I received the following warning.

WARN[0000] /opt/bitwarden/bwdata/docker/docker-compose.yml: version is obsolete

bitwarden@bitwarden:/opt/bitwarden$ ./bitwarden.sh stop
 _     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2024, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2024.2.3
Docker version 25.0.4, build 1a576c5
Docker Compose version v2.25.0

WARN[0000] /opt/bitwarden/bwdata/docker/docker-compose.yml: `version` is obsolete 
WARN[0000] /opt/bitwarden/bwdata/docker/docker-compose.yml: `version` is obsolete 
[+] Running 13/13
 ✔ Container bitwarden-attachments    Removed                                                                                                                                                                   1.2s 
 ✔ Container bitwarden-nginx          Removed                                                                                                                                                                   0.8s 
 ✔ Container bitwarden-icons          Removed                                                                                                                                                                   2.2s 
 ✔ Container bitwarden-sso            Removed                                                                                                                                                                   1.7s 
 ✔ Container bitwarden-events         Removed                                                                                                                                                                   2.1s 
 ✔ Container bitwarden-notifications  Removed                                                                                                                                                                   2.4s 
 ✔ Container bitwarden-api            Removed                                                                                                                                                                   1.8s 
 ✔ Container bitwarden-identity       Removed                                                                                                                                                                   2.1s 
 ✔ Container bitwarden-web            Removed                                                                                                                                                                   1.8s 
 ✔ Container bitwarden-admin          Removed                                                                                                                                                                   2.0s 
 ✔ Container bitwarden-mssql          Removed                                                                                                                                                                   0.8s 
 ✔ Network docker_default             Removed                                                                                                                                                                   0.2s 
 ✔ Network docker_public              Removed                                                                                                                                                                   0.1s 
bitwarden@bitwarden:/opt/bitwarden$

One of the changes in docker compose v2.25.0 is to bump compose-go to v2.0.0.

https://github.com/docker/compose/releases https://github.com/docker/compose/pull/11623

And one of the changes for compose-go v2.0.0 is to "warn user version is obsolete".

https://github.com/compose-spec/compose-go/releases/tag/v2.0.0 https://github.com/compose-spec/compose-go/pull/575

From the above pull request.

Since compose-specification was released, version attribute is obsolete as it doesn't guarantee any form of compatibility. While users adopted new features introduced in the spec, we still see many of them using version: "3" in compose files.

This adds a warning to encourage users to stop using this useless attirbute

bitwarden@bitwarden:/opt/bitwarden$ grep -i version bwdata/docker/docker-compose.yml 
version: '3'
bitwarden@bitwarden:/opt/bitwarden$
Greenderella commented 6 months ago

Hi there!

Thank you for your report, it seems like it is a duplicate of this one https://github.com/bitwarden/self-host/issues/222

If you wish to add any further information/screenshots/recordings etc., please feel free to do so at any time in there - our engineering team will be happy to review these.

This issue will now be closed.

Thanks!

vinnyperella commented 6 months ago

Hi there!

Thank you for your report, it seems like it is a duplicate of this one #222

If you wish to add any further information/screenshots/recordings etc., please feel free to do so at any time in there - our engineering team will be happy to review these.

This issue will now be closed.

Thanks!

This is not a duplicate of https://github.com/bitwarden/self-host/issues/222 this is a completely different issue. It's complaining about the "version: '3'" parameter inside the docker-compose.yml file that's used to start Bitwarden. In the latest version of the docker compose binary the version parameter is deprecated.

GrahamTolhurst commented 6 months ago

I have to agree with @vinnyperella, this issue is not related to #222 I've manually commented out the version line in docker-compose.yml, and the warning is no longer given when starting bitwarden. It appears the current docker-compose.yml is not fully compatible with the latest docker compose version. Removing the version line makes it compatible.

vinnyperella commented 6 months ago

@Greenderella could you please reopen this issue? It's not a high priority since it's just a warning but as I mentioned in my initial issue post it could cause some concern for people running Bitwarden self-hosted that are not aware of the reason for the warning. The solution should be to remove the version parameter from docker-compose.yml as @GrahamTolhurst mentioned the parameter is obsolete anyway.

Greenderella commented 6 months ago

Sorry, I misinterpreted the issue. This has been escalated for further investigation. If you have more information that can help us, please add it below.

Regards