Docker Community Forums

Share and learn in the Docker community.

Portainer: Stack - Deployment Error: A stack with the name is already running

Hi there,

if i understand correctly, then the stack in Portainer is actually docker-compose.

I just wanted to create the nginx-proxy-manager with “create stack” in the Portainer web-editor mode, where the following error is displayed.

Deployment Error: A stack with the name “nginx” is already running.

When i look at the overview, there is no stack called “nginx” or container called “nginx” running.

Can someone help me with this and tell me, how i can remove the “nonexistent stack” so that i can deploy it under the name “nginx”.

Thanks in advance!
Christoph

(Unfortunately it is not possible for me to post a screenshot because i am a newly registered user.)

Hi

Either a Docker Compose project or a Docker Swarm stack. It depends on whether docker swarm is initialized or not.

I should know more about your environment to tell you more, so here is some guesses.

1 ) Containers in a Docker Compose project have labels like

"Labels": {
   "com.docker.compose.config-hash": "3648d148a955550a3952bef39573c7e7daca369011f154bad33f6e4ff3522709",
   "com.docker.compose.container-number": "1",
   "com.docker.compose.oneoff": "False",
   "com.docker.compose.project": "dockertest",
   "com.docker.compose.project.config_files": "docker-compose.yml",
   "com.docker.compose.project.working_dir": "/home/ta/dockertest",
   "com.docker.compose.service": "httpd",
   "com.docker.compose.version": "1.27.4"
},

If you have a container which has some of the labels but not all, it might confuse Portainer. For me it is enough to define “com.docker.compose.project” so this is probably not the case.

2 ) Somehow your docker stack became hidden. Portainer 2 has hidden container feature in settings. If all of your containers are hidden in a stack, you won’t see the stack itself in Portainer.

3 ) You have a stack with the same name but you don’t have permission to see it. When you create users with access to the environment they will only see stacks assigned to them or created by them.

4 ) You have a stack with similar but somehow invalid name which was normalized and became the same behind the scenes

(Ui: Sorry for not using the standard “numbered list” but using that the numbers disappear.)