Portainer logo
By Érico Andrei

Portainer "Unable to find an agent on any manager node"

I frequently rely on Portainer to oversee my Docker Swarm clusters. For the most part, it's been a seamless experience. Portainer offers an intuitive interface that allows me to swiftly review services, delve into container details, and implement quick fixes.

However, there are moments when things don't go as smoothly. For instance, if a Docker Swarm host reboots or there's a Docker service restart, Portainer might occasionally display an error message: "Unable to find an agent on any manager node". It can be puzzling, especially when a quick check on one of the manager nodes indicates that the Portainer agents appear to be functioning correctly.

Fortunately, there's a straightforward solution to this hiccup. By forcing the agents to reboot, the issue can be resolved. This can be achieved with the following command being run on a manager node:

docker service update portainer_agent --force

In conclusion, while Portainer is an invaluable tool for managing Docker Swarm clusters, it's not without its quirks like any other software. Navigating and troubleshooting these minor challenges ensures a smoother and more efficient container management experience.