How do I resolve "stack/module with this slug already exists" error when the stack is not visible?
Last updated: September 16, 2025
Context
When attempting to create stacks through a Spacelift admin stack, you may encounter an error stating "stack/module with this slug already exists for this account".
Answer
If you encounter this error, follow these steps to resolve the issue:
First, try accessing the stack directly using its URL:
Example: https://your-domain.spacelift.io/stack/[stack-name]If your stack was created via and admin stack, you can use a task to delete this stack, remove it from your source code, directly via the UI or by using the Spacelift CLI:
spacectl stack delete --id [stack-name]When prompted, confirm the deletion by typing 'y'
After deleting the stacks, retry your admin stack operation to recreate the stacks
If you're unable to resolve the issue using these steps, contact Spacelift support to investigate the stack state in the database.
Note: When deleting stacks, check the Infrastructure as Code (IaC) management tab first to verify if the stack is managing any active resources to avoid unintended resource deletion.