portainer: A stack with the name is already running

Bug description When attempting to start a stack, Portainer fails with the error message A stack with the name <Stack Name> is already running.

Expected behavior The Stack should start without any error messages.

Technical details:

  • Portainer version: 2.16.2
  • Platform (windows/linux): Linux
  • Have you reviewed our technical documentation and knowledge base? Yes

Additional context The Stack in question is stopped. There are no containers running on this instance when the error is reported. This is validated through Portainer and from Docker too.

The current workaround to start the Stack is to go to the Stack Editor and click on the Update the stack button without making any changes to the yaml.

I run multiple environments managed by the same Portainer instance and this errors happens in only one of the environments.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 10
  • Comments: 39

Most upvoted comments

same issue here, my solution without modify the bolt database

  1. Save your docker compose first
  2. Delete the stack
  3. Now you will see another stack with the same name in running state
  4. Stop that stack then start it, done!

same issue here, my solution without modify the bolt database

  1. Save your docker compose first
  2. Delete the stack
  3. Now you will see another stack with the same name in running state
  4. Stop that stack then start it, done!

I fixed mine by openning the stack, clicking on Editor tab and clicking Update the stack without anyting else (like image repulling or so, just update stack) and it appears as active now and i can stop it.

Same. More than a year after and still unresolved?

Hi @tamarahenson

Might be a bit too late. I resolved the issue by shutting down portainer and manually deleting what seems to have been an orphan Stack in portainer.db using boltbrowser

The 2nd/Orphan Stack had the same name and same endpoint but there was no way I could make it show up in the UI even when I enabled the Show all orphaned stacks option.

I even tried to delete the Stack using the API (DELETE stacks/{id}) but was getting an error message Object not found inside the database

Anyways thankfully I figured out how to resolve it but have no idea how it occurred.

Thanks

update from my side: I could “revive” the stack by removing all the containers belonging to the stack including non persistent volumes and then simply do a “pull and redeploy”. After that, the stack “healed” itself and was not marked as “inactive” any longer.

Same thing happened to me when I stopped a stack then wanted to start it again…

What I did was:

a) Copy the stacks text into a text editor b) delete the stack c) Check if in portainer there is somehow another stack even though you deleted it d) delete that too e) create the stack again new with the copied things from the editor (under the same stack name preferably)

I consistently have this issue. Trying to remember how I fixed it but about to try op suggestion. It usually resort in me having to restart docker fully. But I’d prefer to not have everything down. I think the update solution was it for now.

Only happens when I’m needing to stop and start a stack quickly. Maybe I should be just restarting the container.