[Command] Warden Env Up for Magento 2 no longer works after deleting the containers from Docker Desktop
AnimNyan opened this issue · 7 comments
Version of Warden
0.14.2
Operating System and Installation Method
Ubuntu 22.0.3 LTS WSL 2 via Brew
Describe the Bug
So I deleted all the containers in Docker Desktop for Windows permanently this was my fault. I thought I could save some space since I had Magento containers I was no longer using for different environments. However, deleting all the stopped docker containers just messed up my working existing magento 2 environments.
Now every time that I run warden env up I get this error message:
warden env up
validating /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/varnish.base.yml: services.nginx.labels array items[2,7] must be unique
I am using Ubuntu via WSL 2 and I have tried uninstalling Ubuntu and reinstalling Ubuntu. Same error.
I have tried uninstalling and reinstall Docker Desktop for windows.
I have also tried installing and reinstalling warden via brew, but it still has the same error.
Is there anything I can do to fix up my mistake? Since whatever I do I'm still encountering the same error.
To Reproduce
- Go to Docker Desktop for windows and select all the docker containers and permanently delete them.
- Use the following command to bring up the warden: warden svc up
[+] Running 4/4
✔ Container traefik Started 0.0s
✔ Container tunnel Started 0.0s
✔ Container dnsmasq Running 0.0s
✔ Container mailhog Running 0.0s - Use this command: warden env up
validating /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/varnish.base.yml: services.nginx.labels array items[2,7] must be unique
Expected Behavior
After using warden env up I expect it to bring up the environment as per usual, but since I deleted all the containers I think I permanently messed up warden. I have reinstalled the entire virtual machine Ubuntu. But it doesn't work, so I'm guessing this might be stored permanently on docker desktop itself.
Additional context
No response
Honestly ahaha I was really stupid here but any advice or suggestions on how I can reset warden would be immensely appreciated! Thank you!
I'm currently trying to clear my Docker Desktop Appdata Local folders after uninstalling Docker Destkop as that's the only place where I can think that configuration may have been retained after I uninstalled both the Ubuntu distro and Docker Desktop itself.
Edit: This did not help after reinstalling docker desktop I have the same error and am still stuck when I use warden env up.
It seems to be referring to this file here: https://github.com/wardenenv/warden/blob/main/environments/includes/varnish.base.yml and the labels but not sure how I can fix it.
My file at the path /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/varnish.base.yml looks exactly the same as the github file here:
version: "3.5"
services:
nginx:
labels:
- traefik.enable=false
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.priority=2
- traefik.docker.network=${WARDEN_ENV_NAME}_default
varnish:
hostname: "${WARDEN_ENV_NAME}-varnish"
image: ${WARDEN_IMAGE_REPOSITORY}/varnish:${VARNISH_VERSION:-6.0}
depends_on:
- nginx
labels:
- traefik.enable=true
- traefik.http.routers.${WARDEN_ENV_NAME}-varnish.tls=true
- traefik.http.routers.${WARDEN_ENV_NAME}-varnish.priority=1
- traefik.http.routers.${WARDEN_ENV_NAME}-varnish.rule=
HostRegexp({subdomain:.+}.${TRAEFIK_DOMAIN}
) || Host(${TRAEFIK_DOMAIN}
)
- traefik.http.services.${WARDEN_ENV_NAME}-varnish.loadbalancer.server.port=80
- traefik.docker.network=${WARDEN_ENV_NAME}_default
Wait so I removed the varnish file by using the following commands in hopes that it would regenerate something like this:
cd /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/
rm rm varnish.base.yml
and then when I cd into the Sites/feb2024 directory it did a pull and warden env up worked:
warden env up
[+] Running 78/26
✔ db 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 67.8s
✔ redis 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 14.9s
✔ opensearch 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 142.4s
✔ rabbitmq 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 14.8s
✔ php-fpm 26 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 115.0s
✔ nginx 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 67.9s
✔ php-debug 4 layers [⣿⣿⣿⣿] 0B/0B Pulled 115.3s
[+] Creating 15/15
✔ Network feb2024_default Created 0.0s
✔ Volume "feb2024_rabbitmq" Created 0.0s
✔ Volume "feb2024_redis" Created 0.0s
✔ Volume "feb2024_bashhistory" Created 0.0s
✔ Volume "feb2024_sshdirectory" Created 0.0s
✔ Volume "feb2024_dbdata" Created 0.0s
✔ Volume "feb2024_sqlhistory" Created 0.0s
✔ Volume "feb2024_osdata" Created 0.0s
✔ Container feb2024-opensearch-1 Created 1.1s
✔ Container feb2024-rabbitmq-1 Created 1.1s
✔ Container feb2024-redis-1 Created 1.0s
✔ Container feb2024-db-1 Created 1.1s
✔ Container feb2024-php-fpm-1 Created 0.2s
✔ Container feb2024-nginx-1 Created 0.2s
✔ Container feb2024-php-debug-1 Created 0.3s
Connecting traefik to feb2024_default network
Connecting tunnel to feb2024_default network
Connecting mailhog to feb2024_default network
[+] Running 7/7
✔ Container feb2024-php-fpm-1 Started 3.8s
✔ Container feb2024-nginx-1 Started 3.4s
✔ Container feb2024-php-debug-1 Started 3.2s
✔ Container feb2024-redis-1 Started 1.1s
✔ Container feb2024-db-1 Started 1.1s
✔ Container feb2024-opensearch-1 Started 0.7s
✔ Container feb2024-rabbitmq-1 Started 1.3s
Honestly, I have zero clue why that worked. I don't even have the varnish.base.yml file anymore I checked in the directory /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes , I'm going to uninstall Warden and install warden once more to make it clean hopefully.
Okay yeah did a reinstall of warden via these commands:
brew uninstall wardenenv/warden/warden
brew install wardenenv/warden/warden
then warden env up
validating /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/varnish.base.yml: services.nginx.labels array items[2,7] must be unique
doesn't work anymore I have to delete the/home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/ varnish.base.yml file manually, before it works I don't know why.
So my question is does anyone know why a manual delete is required, is this a bug?
And is there any permanent fix to this?
@AnimNyan This looks like a duplicate of #745 which was a Docker issue and not a Warden issue. Docker 4.27.2 seems to resolve this issue: https://docs.docker.com/desktop/release-notes/#4272
Cc @navarr
Following up on bap14, @AnimNyan I just want to assure you that deleting your containers did not cause this - it's a weird thing in Docker. Please make sure your version of docker is up to date!
@bap14 and @navarr perfect that solves it! I updated Docker to 4.27.2 and confirmed that that solves the error of
validating /home/linuxbrew/.linuxbrew/Cellar/warden/0.14.2/environments/includes/varnish.base.yml: services.nginx.labels array items[2,7] must be unique
I confirmed warden env up now works!
Thank you so much! You both saved the day, because I was clean reinstalling everything yesterday to no effect, but you both found the solution so I am very thankful!