Every now and again a stack will break and throw and error that the docker-compose.yml does not exist so it can not be deleted..
To remove the stack a new one will need to be created. If you copy the link to the broken container, it will show an ID number.
Take note of this as it directly refers to the location of the missing docker-compose.yml file.
In the terminal, list the contents of the stored docker-compose.yml files (default):
sudo ls /var/lib/docker/volumes/portainer_data/_data/compose/
The number you took down earlier should be missing.
Let’s make a directory with your missing number:
sudo mkdir /var/lib/docker/volumes/portainer_data/_data/compose/<number>
Now we need to make up a docker-compose.yml file:
sudo nano /var/lib/docker/volumes/portainer_data/_data/compose/<number>/docker-compose.yml
Just so a change is made, I place a single # (hash / pound) to comment as to register a change.
Save the file by pressing [ctrl] + [X], then [Y], then [enter].
Now go back to your portainer webUI and the broken stack will delete!
😀
