This error occur when we are  trying  to add a node that  already using  the node in our Docker swarm earlier. So if we  want to add the node in another swarm, then we  need to leave from the earlier swarm by using the command:  $ docker swarm leave --force
Node left the swarm.