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: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 23

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!

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 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. 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