Missing Stacks After Restore

by ADMIN 29 views

Problem Description

I restored from a backup but I can't see any stacks. I cant recreate the stacks using the same name. There are no other containers or services running.

Expected Behavior

The list of stacks are shown in the list.

Actual Behavior

When I see the dashboard it says there's 9 stacks, but when i look at the stacks there is none. I cannot recreate any stacks with the same name that I used before.

Steps to Reproduce

Create a backup. Start fresh and restore the backup.

Portainer Logs or Screenshots

Shows 9 stacks Image

No stacks shown in list (Show all orphaned stacks is checked) Image

Trying to recreate a stack but not allowed Image

Can see the data from the restored backup here Image

Docker Service and Container List

$ docker service ls
ID             NAME                  MODE         REPLICAS   IMAGE                        PORTS
1rr7k6vzqcua   portainer_agent       global       2/2        portainer/agent:lts          
vb9k0xnre8om   portainer_portainer   replicated   1/1        portainer/portainer-ce:lts   *:8000->8000/tcp, *:9000->9000/tcp, *:9443->9443/tcp
$ docker container ls
CONTAINER ID   IMAGE                        COMMAND                  CREATED          STATUS          PORTS                          NAMES
64bb754dd37b   portainer/portainer-ce:lts   "/portainer -H tcp:/…"   12 minutes ago   Up 12 minutes   8000/tcp, 9000/tcp, 9443/tcp   portainer_portainer.1.bk7evgthc76iaz8sx68xzoa7m
bae5816d5752   portainer/agent:lts          "./agent"                12 minutes ago   Up 12 minutes                                  portainer_agent.i8u12xvvw251cnng81t9isucl.or4n80yacgm4voqb2vctcy6za

Portainer Version and Edition

  • Portainer Version: 2.27.1
  • Portainer Edition: Community Edition (CE)

Platform and Version

  • Docker Swarm: 28.0.1

OS and Architecture

  • Debian: 12
  • Architecture: Not specified

Browser

  • Arc: 1.85.1 (59724)

What Command Did You Use to Deploy Portainer?

docker swarm init --default-addr-pool 172.20.0.0/16 --default-addr-pool-mask-length 24
docker stack deploy -c portainer-agent-stack.yml portainer
# $ cat portainer-agent-stack.yml

version: '3.2'

services:
  agent:
    image: portainer/agent:lts
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    networks:
      - agent_network
    deploy:
      mode: global
      placement:
        constraints: [node.platform.os == linux]

  portainer:
    image: portainer/portainer-ce:lts
    command: -H tcp://tasks.agent:9001 --tlsskipverify
    ports:
      - "9443:9443"
      - "9000:9000"
      - "8000:8000"
    volumes:
      - portainer_data:/data
    networks:
      - agent_network
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]

networks:
  agent_network:
    driver: overlay
    attachable: true

volumes:
  portainer_data:

Additional Information

Seems similar too https://github.com/portainer/portainer/issues/12547

Troubleshooting Steps

  1. Check Docker Service and Container List: Make sure that the Docker service and container list are correct and that there are no issues with the Docker installation.
  2. Check Portainer Logs: Check the Portainer logs for any errors or issues that may be related to the missing stacks.
  3. Check Backup and Restore Process: Make sure that the backup and restore process was successful and that there are no issues with the backup file.
  4. Check Stack Configuration: Check the stack configuration to make sure that it is correct and that there are no issues with the stack definition.
  5. Check Portainer Version and Edition: Make sure that the Portainer version and edition are correct and that there are no issues with the Portainer installation.

Conclusion

Q: What is the issue with missing stacks after restore in Portainer?

A: The issue with missing stacks after restore in Portainer is that the stacks are not visible in the Portainer dashboard, even though they were created and deployed successfully.

Q: What are the symptoms of this issue?

A: The symptoms of this issue include:

  • The stacks are not visible in the Portainer dashboard.
  • The stack list is empty, even though there are stacks deployed.
  • Trying to recreate a stack with the same name is not allowed.

Q: What are the possible causes of this issue?

A: The possible causes of this issue include:

  • Issues with the Docker service and container list.
  • Issues with the Portainer logs.
  • Issues with the backup and restore process.
  • Issues with the stack configuration.
  • Issues with the Portainer version and edition.

Q: How can I troubleshoot this issue?

A: To troubleshoot this issue, follow these steps:

  1. Check Docker Service and Container List: Make sure that the Docker service and container list are correct and that there are no issues with the Docker installation.
  2. Check Portainer Logs: Check the Portainer logs for any errors or issues that may be related to the missing stacks.
  3. Check Backup and Restore Process: Make sure that the backup and restore process was successful and that there are no issues with the backup file.
  4. Check Stack Configuration: Check the stack configuration to make sure that it is correct and that there are no issues with the stack definition.
  5. Check Portainer Version and Edition: Make sure that the Portainer version and edition are correct and that there are no issues with the Portainer installation.

Q: What are the possible solutions to this issue?

A: The possible solutions to this issue include:

  • Update Portainer to the latest version: Make sure that Portainer is updated to the latest version to ensure that there are no issues with the installation.
  • Check and fix Docker service and container list: Make sure that the Docker service and container list are correct and that there are no issues with the Docker installation.
  • Check and fix Portainer logs: Check the Portainer logs for any errors or issues that may be related to the missing stacks.
  • Check and fix backup and restore process: Make sure that the backup and restore process was successful and that there are no issues with the backup file.
  • Check and fix stack configuration: Check the stack configuration to make sure that it is correct and that there are no issues with the stack definition.

Q: What are the best practices to prevent this issue?

A: The best practices to prevent this issue include:

  • Regularly update Portainer to the latest version: Make sure that Portainer is updated to the latest version to ensure that there are no issues with the installation.
  • Regularly check and fix Docker service and container list: Make sure that the Docker service and container list are correct and that there are no issues with the Docker installation.
  • Regularly check and fix Portainer logs: Check the Portainer logs for any errors or issues that may be related to the missing stacks.
  • Regularly check and fix backup and restore process: Make sure that the backup and restore process was successful and that there are no issues with the backup file.
  • Regularly check and fix stack configuration: Check the stack configuration to make sure that it is correct and that there are no issues with the stack definition.

Q: Where can I find more information about this issue?

A: You can find more information about this issue on the Portainer documentation website, as well as on the Portainer community forum.